From 55af40ee747fbf872eb5bb07a49ea4cd276e8c34 Mon Sep 17 00:00:00 2001 From: kb <47297843+kbd0t@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:35:35 +0200 Subject: [PATCH] MessageLogger: Add user ignore list (#1275) Co-authored-by: V --- src/plugins/messageLogger/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index 2da7c2e68..2041f70ff 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -147,6 +147,11 @@ export default definePlugin({ type: OptionType.BOOLEAN, description: "Whether to ignore messages by yourself", default: false + }, + ignoreUsers: { + type: OptionType.STRING, + description: "Comma-separated list of user IDs to ignore", + default: "" } }, @@ -154,7 +159,7 @@ export default definePlugin({ try { if (cache == null || (!isBulk && !cache.has(data.id))) return cache; - const { ignoreBots, ignoreSelf } = Settings.plugins.MessageLogger; + const { ignoreBots, ignoreSelf, ignoreUsers } = Settings.plugins.MessageLogger; const myId = UserStore.getCurrentUser().id; function mutate(id: string) { @@ -165,7 +170,8 @@ export default definePlugin({ const shouldIgnore = data.mlDeleted || (msg.flags & EPHEMERAL) === EPHEMERAL || ignoreBots && msg.author?.bot || - ignoreSelf && msg.author?.id === myId; + ignoreSelf && msg.author?.id === myId || + ignoreUsers.includes(msg.author?.id); if (shouldIgnore) { cache = cache.remove(id);