Skip to content
Snippets Groups Projects
Unverified Commit 64f42312 authored by tamaina's avatar tamaina Committed by GitHub
Browse files

ソフトミュートですべてがマッチしてしまうのを修正 (#8307)


* ソフトミュートですべてがマッチしてしまうのを修正

* Clean up

* Update packages/client/src/scripts/check-word-mute.ts

Co-authored-by: default avatarsyuilo <Syuilotan@yahoo.co.jp>

* fix

Co-authored-by: default avatarsyuilo <Syuilotan@yahoo.co.jp>
parent 3cf9c309
No related branches found
No related tags found
No related merge requests found
......@@ -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(/^\/(.+)\/(.*)$/);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment