From b84a10a6ec6f79543bc7230f66527f65f51b9c34 Mon Sep 17 00:00:00 2001 From: naskya Date: Sun, 10 Sep 2023 05:00:06 +0900 Subject: [PATCH] make word mutes case insensitive (close #10724) --- packages/backend/src/misc/check-word-mute.ts | 4 +++- packages/client/src/scripts/check-word-mute.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index 8c7d950861..a75beed9d1 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -33,7 +33,9 @@ function checkWordMute( if ( keywords.length > 0 && - keywords.every((keyword) => text.includes(keyword)) + keywords.every((keyword) => + text.toLowerCase().includes(keyword.toLowerCase()), + ) ) return true; } else { diff --git a/packages/client/src/scripts/check-word-mute.ts b/packages/client/src/scripts/check-word-mute.ts index 50188a83ba..bec824fb21 100644 --- a/packages/client/src/scripts/check-word-mute.ts +++ b/packages/client/src/scripts/check-word-mute.ts @@ -26,7 +26,9 @@ function checkWordMute( if ( keywords.length > 0 && - keywords.every((keyword) => text.includes(keyword)) + keywords.every((keyword) => + text.toLowerCase().includes(keyword.toLowerCase()), + ) ) { result.muted = true; result.matched.push(...keywords);