mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 11:39:21 +03:00
Some Sieve parser improvements
This commit is contained in:
parent
61c2eefec1
commit
4022d39f76
7 changed files with 32 additions and 18 deletions
|
|
@ -80,7 +80,8 @@ export class VacationCommand extends ActionCommand
|
|||
this.addresses = arg; // GrammarStringList
|
||||
} else if (i && ':' === args[i-1][0]) {
|
||||
// :days, :seconds, :subject, :from, :handle
|
||||
this[args[i-1].replace(':','_')].value = arg.value;
|
||||
let p = args[i-1].replace(':','_');
|
||||
this[p] ? (this[p].value = arg.value) : console.log('Unknown VacationCommand :' + p);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export class VirusTestTest extends TestCommand
|
|||
this._value = new GrammarQuotedString; // 1 - 5
|
||||
}
|
||||
|
||||
get require() { return /:value|:count/.test(this.match_type) ? ['virustest','relational'] : 'virustest'; }
|
||||
get require() { return /:value/.test(this.match_type) ? ['virustest','relational'] : 'virustest'; }
|
||||
|
||||
get value() { return this._value.value; }
|
||||
set value(v) { this._value.value = v; }
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ export class NotifyCommand extends ActionCommand
|
|||
this.options = arg; // GrammarStringList
|
||||
} else if (i && ':' === args[i-1][0]) {
|
||||
// :from, :importance, :message
|
||||
this[args[i-1].replace(':','_')].value = arg.value;
|
||||
let p = args[i-1].replace(':','_');
|
||||
this[p] ? (this[p].value = arg.value) : console.log('Unknown VacationCommand :' + p);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ export class ReplaceCommand extends ActionCommand
|
|||
this.mime = true;
|
||||
} else if (i && ':' === args[i-1][0]) {
|
||||
// :subject, :from
|
||||
this[args[i-1].replace(':','_')].value = arg.value;
|
||||
let p = args[i-1].replace(':','_');
|
||||
this[p] ? (this[p].value = arg.value) : console.log('Unknown VacationCommand :' + p);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -148,7 +149,8 @@ export class EncloseCommand extends ActionCommand
|
|||
args.forEach((arg, i) => {
|
||||
if (i && ':' === args[i-1][0]) {
|
||||
// :subject, :headers
|
||||
this[args[i-1].replace(':','_')].value = arg.value;
|
||||
let p = args[i-1].replace(':','_');
|
||||
this[p] ? (this[p].value = arg.value) : console.log('Unknown VacationCommand :' + p);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export class ValidExtListTest extends TestCommand
|
|||
{
|
||||
constructor()
|
||||
{
|
||||
super();
|
||||
super('valid_ext_list');
|
||||
this.ext_list_names = new GrammarStringList;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue