From a36e5b4543f651d10176003974d99b4a5545ede1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 9 Sep 2019 22:18:32 +0900 Subject: [PATCH] Refactoring --- src/server/api/endpoints/messaging/messages/create.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/server/api/endpoints/messaging/messages/create.ts b/src/server/api/endpoints/messaging/messages/create.ts index d0c1ee494..7ecbac9fe 100644 --- a/src/server/api/endpoints/messaging/messages/create.ts +++ b/src/server/api/endpoints/messaging/messages/create.ts @@ -195,10 +195,7 @@ export default define(meta, async (ps, user) => { const mute = await Mutings.find({ muterId: recipientUser.id, }); - const mutedUserIds = mute.map(m => m.muteeId.toString()); - if (mutedUserIds.indexOf(user.id) != -1) { - return; - } + if (mute.map(m => m.muteeId).includes(user.id)) return; //#endregion publishMainStream(recipientUser.id, 'unreadMessagingMessage', messageObj);