From 3b3da4276383517f45ab3949f780fa5236115e11 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 5 May 2023 06:16:23 +0900 Subject: [PATCH] clean up --- packages/backend/src/misc/check-word-mute.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index d28e446ccf..5d0cd581fa 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -12,10 +12,6 @@ type UserLike = { id: User["id"]; }; -function escapeRegExp(x: string): string { - return x.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string -} - function checkWordMute( note: NoteLike, mutedWords: Array, @@ -34,7 +30,7 @@ function checkWordMute( // This should never happen due to input sanitisation. if (!regexp) { - console.warn(`Found invalid regex in word mutes: ${mutePattern}`); + console.warn(`Found invalid regex in word mutes: ${filter}`); return false; } @@ -63,8 +59,8 @@ export async function getWordHardMute( if (mutedWords.length > 0) { return ( checkWordMute(note, mutedWords) || - checkWordMute(reply, mutedWords) || - checkWordMute(renote, mutedWords) + checkWordMute(note.reply, mutedWords) || + checkWordMute(note.renote, mutedWords) ); }