summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2022-02-11 23:26:51 +0900
committerGitHub <noreply@github.com>2022-02-11 23:26:51 +0900
commit64f4231283bfe6bb6b2a56e60a0b7fd99027cdbe (patch)
tree7a9c7d13bc02f9c8640ea68fdc57275580a49c04 /packages/client/src/scripts
parent12.106.3 (diff)
downloadsharkey-64f4231283bfe6bb6b2a56e60a0b7fd99027cdbe.tar.gz
sharkey-64f4231283bfe6bb6b2a56e60a0b7fd99027cdbe.tar.bz2
sharkey-64f4231283bfe6bb6b2a56e60a0b7fd99027cdbe.zip
ソフトミュートですべてがマッチしてしまうのを修正 (#8307)
* ソフトミュートですべてがマッチしてしまうのを修正 * Clean up * Update packages/client/src/scripts/check-word-mute.ts Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> * fix Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/client/src/scripts')
-rw-r--r--packages/client/src/scripts/check-word-mute.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/client/src/scripts/check-word-mute.ts b/packages/client/src/scripts/check-word-mute.ts
index 74e2581863..fa74c09939 100644
--- a/packages/client/src/scripts/check-word-mute.ts
+++ b/packages/client/src/scripts/check-word-mute.ts
@@ -7,7 +7,11 @@ export function checkWordMute(note: Record<string, any>, me: Record<string, any>
const matched = mutedWords.some(filter => {
if (Array.isArray(filter)) {
- return filter.every(keyword => note.text!.includes(keyword));
+ // Clean up
+ const filteredFilter = filter.filter(keyword => keyword !== '');
+ if (filteredFilter.length === 0) return false;
+
+ return filteredFilter.every(keyword => note.text!.includes(keyword));
} else {
// represents RegExp
const regexp = filter.match(/^\/(.+)\/(.*)$/);