From 6a715da1acc9fadbd3df71f40fe9e75c734459c9 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 8 Jan 2024 04:55:18 +0100 Subject: [PATCH] Bugfix Sieve rfc5429 --- dev/Sieve/Extensions/rfc5429.js | 53 ++++++++++----------------------- 1 file changed, 15 insertions(+), 38 deletions(-) diff --git a/dev/Sieve/Extensions/rfc5429.js b/dev/Sieve/Extensions/rfc5429.js index d422f2eb8..984fa2eb9 100644 --- a/dev/Sieve/Extensions/rfc5429.js +++ b/dev/Sieve/Extensions/rfc5429.js @@ -8,22 +8,17 @@ import { GrammarString } from 'Sieve/Grammar'; -/** - * https://tools.ietf.org/html/rfc5429#section-2.1 - */ -export class ErejectCommand extends ActionCommand +class rfc5429Command extends ActionCommand { - constructor() + constructor(identifier) { - super(); + super(identifier); this._reason = new GrammarQuotedString; } - get require() { return 'ereject'; } - toString() { - return 'ereject ' + this._reason + ';'; + return this.require + ' ' + this._reason + ';'; } get reason() @@ -44,38 +39,20 @@ export class ErejectCommand extends ActionCommand } } +/** + * https://tools.ietf.org/html/rfc5429#section-2.1 + */ +export class ErejectCommand extends rfc5429Command +{ + constructor() { super('ereject'); } + get require() { return 'ereject'; } +} + /** * https://tools.ietf.org/html/rfc5429#section-2.2 */ -export class RejectCommand extends ActionCommand +export class RejectCommand extends rfc5429Command { - constructor() - { - super(); - this._reason = new GrammarQuotedString; - } - + constructor() { super('reject'); } get require() { return 'reject'; } - - toString() - { - return 'reject ' + this._reason + ';'; - } - - get reason() - { - return this._reason.value; - } - - set reason(value) - { - this._reason.value = value; - } - - pushArguments(args) - { - if (args[0] instanceof GrammarString) { - this._reason = args[0]; - } - } }