From 1108a83ea514c13cba8cd078bd027668ce3c5877 Mon Sep 17 00:00:00 2001 From: Dark <7890309+DarkView@users.noreply.github.com> Date: Sun, 19 Apr 2020 20:58:17 +0200 Subject: [PATCH] automod: Edit support and edit-reflag prevention --- backend/src/plugins/Automod/Automod.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/src/plugins/Automod/Automod.ts b/backend/src/plugins/Automod/Automod.ts index 9949cc14..70d712f4 100644 --- a/backend/src/plugins/Automod/Automod.ts +++ b/backend/src/plugins/Automod/Automod.ts @@ -237,6 +237,8 @@ export class AutomodPlugin extends ZeppelinPlugin this.onMessageCreate(msg); this.savedMessages.events.on("create", this.onMessageCreateFn); + this.savedMessages.events.on("update", this.onMessageCreateFn); + this.actionedMessageIds = []; } protected getModActions(): ModActionsPlugin { @@ -365,6 +369,8 @@ export class AutomodPlugin extends ZeppelinPlugin { if (this.unloaded) return; @@ -1504,6 +1511,13 @@ export class AutomodPlugin extends ZeppelinPlugin this.actionedMessageMax) { + this.actionedMessageIds.shift(); + } + break; // Don't apply multiple rules to the same message } }