mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 05:59:21 +03:00
Get most valid Sieve scripts parsed properly
This commit is contained in:
parent
c254025d7a
commit
76ade5eac0
25 changed files with 175 additions and 71 deletions
|
|
@ -58,13 +58,45 @@ export const
|
|||
serverErrorDesc(text);
|
||||
},
|
||||
|
||||
getComparators = () => ['i;ascii-casemap'],
|
||||
koObserve = (obj, prop) => {
|
||||
// Object.getOwnPropertyNames(obj).forEach(prop => {
|
||||
// prop = prop.replace(/^_/, '');
|
||||
obj['ko_' + prop] = ko.computed({
|
||||
read: () => obj[prop],
|
||||
write: (v) => obj[prop] = v,
|
||||
pure:true
|
||||
});
|
||||
// });
|
||||
// Object.preventExtensions(obj);
|
||||
},
|
||||
|
||||
getComparators = (validOnly = 0) => {
|
||||
let result = [
|
||||
// Default
|
||||
'i;ascii-casemap',
|
||||
];
|
||||
if (capa.includes('relational') || !validOnly) {
|
||||
result.push('i;octet');
|
||||
}
|
||||
if (capa.includes('comparator-i;ascii-numeric') || !validOnly) {
|
||||
result.push('i;ascii-numeric');
|
||||
}
|
||||
if (capa.includes('comparator-i;unicode-casemap') || !validOnly) {
|
||||
result.push('i;unicode-casemap');
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
getMatchTypes = (validOnly = 1) => {
|
||||
let result = [':is',':contains',':matches'];
|
||||
// https://datatracker.ietf.org/doc/html/rfc6134#section-2.3
|
||||
// Only available for tests with a key_list property
|
||||
if (capa.includes('extlists') || !validOnly) {
|
||||
result.push(':list');
|
||||
}
|
||||
if (capa.includes('relational') || !validOnly) {
|
||||
result.push(':value');
|
||||
result.push(':count');
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue