aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/noBlockedMessages.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/noBlockedMessages.ts')
-rw-r--r--src/plugins/noBlockedMessages.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/noBlockedMessages.ts b/src/plugins/noBlockedMessages.ts
index 6937041..d91572a 100644
--- a/src/plugins/noBlockedMessages.ts
+++ b/src/plugins/noBlockedMessages.ts
@@ -37,16 +37,19 @@ export default definePlugin({
}
]
},
- {
- find: "displayName=\"MessageStore\"",
+ ...[
+ 'displayName="MessageStore"',
+ 'displayName="ReadStateStore"'
+ ].map(find => ({
+ find,
predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true,
replacement: [
{
- match: /(?<=MESSAGE_CREATE:function\((\w)\){var \w=\w\.channelId,\w=\w\.message,\w=\w\.isPushNotification,\w=\w\.\w\.getOrCreate\(\w\));/,
- replace: ";if($self.isBlocked(n))return;"
+ match: /(?<=MESSAGE_CREATE:function\((\i)\){)/,
+ replace: (_, props) => `if($self.isBlocked(${props}.message))return;`
}
]
- }
+ }))
],
options: {
ignoreBlockedMessages: {