From f43e0caef93be9fd439d15f398fec3f6f5928b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 23 Aug 2024 21:02:10 +0200 Subject: [PATCH] do not duplicate self mentions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/normalizers/status.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/normalizers/status.ts b/src/normalizers/status.ts index d42aac795..e6000ec3b 100644 --- a/src/normalizers/status.ts +++ b/src/normalizers/status.ts @@ -107,7 +107,7 @@ const normalizeStatus = (status: BaseStatus & { // Add self to mentions if it's a reply to self const isSelfReply = status.account.id === status.in_reply_to_account_id; - const hasSelfMention = status.account.id === status.mentions[0]?.id; + const hasSelfMention = status.mentions.some(mention => status.account.id === mention.id); if (isSelfReply && !hasSelfMention) { const selfMention = mentionSchema.parse(status.account);