Add copy action support
This commit is contained in:
parent
23c067e2e7
commit
5c309c9b69
4 changed files with 18 additions and 7 deletions
|
@ -37,6 +37,7 @@ function normalizeRules(rules) {
|
|||
const actions = [];
|
||||
if (r.tag) actions.push({ type: 'tag', tagKey: r.tag });
|
||||
if (r.moveTo) actions.push({ type: 'move', folder: r.moveTo });
|
||||
if (r.copyTarget || r.copyTo) actions.push({ type: 'copy', copyTarget: r.copyTarget || r.copyTo });
|
||||
const rule = { criterion: r.criterion, actions };
|
||||
if (r.stopProcessing) rule.stopProcessing = true;
|
||||
if (r.unreadOnly) rule.unreadOnly = true;
|
||||
|
@ -234,6 +235,8 @@ async function processMessage(id) {
|
|||
}
|
||||
} else if (act.type === 'move' && act.folder) {
|
||||
await messenger.messages.move([id], act.folder);
|
||||
} else if (act.type === 'copy' && act.copyTarget) {
|
||||
await messenger.messages.copy([id], act.copyTarget);
|
||||
} else if (act.type === 'junk') {
|
||||
await messenger.messages.update(id, { junk: !!act.junk });
|
||||
} else if (act.type === 'read') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue