diff options
author | Rendundakat <38409600+Redundakitties@users.noreply.github.com> | 2023-06-09 16:17:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-09 22:17:32 +0200 |
commit | 3410ed024f6cfccb7f2b6fd9a30d647d71b81249 (patch) | |
tree | 808e00ae0f140bc4d22ab66d9cbd280278906026 | |
parent | dbad10984a99b6eb9234ec71f2891a136b6a572b (diff) | |
download | Vencord-3410ed024f6cfccb7f2b6fd9a30d647d71b81249.tar.gz Vencord-3410ed024f6cfccb7f2b6fd9a30d647d71b81249.tar.bz2 Vencord-3410ed024f6cfccb7f2b6fd9a30d647d71b81249.zip |
QuickReply: respect users in userList of NoReplyMention (#1191)
Co-authored-by: V <vendicated@riseup.net>
-rw-r--r-- | src/plugins/quickReply.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/quickReply.ts b/src/plugins/quickReply.ts index d855f9e..06797bc 100644 --- a/src/plugins/quickReply.ts +++ b/src/plugins/quickReply.ts @@ -159,9 +159,12 @@ function getNextMessage(isUp: boolean, isReply: boolean) { return i === - 1 ? undefined : messages[messages.length - i - 1]; } -function shouldMention() { +function shouldMention(message) { + const { enabled, userList, shouldPingListed } = Settings.plugins.NoReplyMention; + const shouldPing = !enabled || (shouldPingListed === userList.includes(message.author.id)); + switch (settings.store.shouldMention) { - case MentionOptions.NO_REPLY_MENTION_PLUGIN: return !Settings.plugins.NoReplyMention.enabled; + case MentionOptions.NO_REPLY_MENTION_PLUGIN: return shouldPing; case MentionOptions.DISABLED: return false; default: return true; } @@ -184,7 +187,7 @@ function nextReply(isUp: boolean) { type: "CREATE_PENDING_REPLY", channel, message, - shouldMention: shouldMention(), + shouldMention: shouldMention(message), showMentionToggle: channel.guild_id !== null && message.author.id !== meId, _isQuickReply: true }); |