From 64f4231283bfe6bb6b2a56e60a0b7fd99027cdbe Mon Sep 17 00:00:00 2001
From: tamaina <tamaina@hotmail.co.jp>
Date: Fri, 11 Feb 2022 23:26:51 +0900
Subject: [PATCH] =?UTF-8?q?=E3=82=BD=E3=83=95=E3=83=88=E3=83=9F=E3=83=A5?=
 =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=A7=E3=81=99=E3=81=B9=E3=81=A6=E3=81=8C?=
 =?UTF-8?q?=E3=83=9E=E3=83=83=E3=83=81=E3=81=97=E3=81=A6=E3=81=97=E3=81=BE?=
 =?UTF-8?q?=E3=81=86=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#8307)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

* 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>
---
 packages/client/src/scripts/check-word-mute.ts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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(/^\/(.+)\/(.*)$/);