mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 21:37:34 -07:00
ソフトミュートですべてがマッチしてしまうのを修正 (#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>
This commit is contained in:
parent
8ccc18b549
commit
787a97706b
1 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,11 @@ export function checkWordMute(note: Record<string, any>, me: Record<string, any>
|
||||||
|
|
||||||
const matched = mutedWords.some(filter => {
|
const matched = mutedWords.some(filter => {
|
||||||
if (Array.isArray(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 {
|
} else {
|
||||||
// represents RegExp
|
// represents RegExp
|
||||||
const regexp = filter.match(/^\/(.+)\/(.*)$/);
|
const regexp = filter.match(/^\/(.+)\/(.*)$/);
|
||||||
|
|
Loading…
Reference in a new issue