feat: introduce ACP defined option to rescind notif or do nothing on flag resolve/reject

/cc #10867
This commit is contained in:
Julian Lam
2022-08-26 16:05:45 -04:00
parent df36d96788
commit 15b1561fd3
5 changed files with 99 additions and 20 deletions

View File

@@ -679,7 +679,10 @@ Flags.update = async function (flagId, uid, changeset) {
} else {
tasks.push(db.sortedSetAdd(`flags:byState:${changeset[prop]}`, now, flagId));
tasks.push(db.sortedSetRemove(`flags:byState:${current[prop]}`, flagId));
if (changeset[prop] === 'resolved' || changeset[prop] === 'rejected') {
if (changeset[prop] === 'resolved' && meta.config['flags:actionOnResolve'] === 'rescind') {
tasks.push(notifications.rescind(`flag:${current.type}:${current.targetId}`));
}
if (changeset[prop] === 'rejected' && meta.config['flags:actionOnReject'] === 'rescind') {
tasks.push(notifications.rescind(`flag:${current.type}:${current.targetId}`));
}
}