From e93d59f04489db55d0b8a275e30a10659fb1b727 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 14 Aug 2021 21:55:38 +0300 Subject: [PATCH] fixed mentions line again --- src/components/status/status.js | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 54f304a2..ac481534 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -166,23 +166,16 @@ const Status = { muteWordHits () { return muteWordHits(this.status, this.muteWords) }, - mentions () { - return this.status.attentions.filter(attn => { - return attn.screen_name !== this.replyToName && - attn.screen_name !== this.status.user.screen_name - }).map(attn => ({ - url: attn.statusnet_profile_url, - content: attn.screen_name, - userId: attn.id - })) - }, mentionsLine () { - const writtenMentions = this.headTailLinks ? this.headTailLinks.writtenMentions : [] - const set = new Set(writtenMentions.map(_ => _.url)) + if (!this.headTailLinks) return [] + const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url)) return this.status.attentions.filter(attn => { - return attn.screen_name !== this.replyToName && - attn.screen_name !== this.status.user.screen_name && - !set.has(attn.url) + // no reply user + return attn.id !== this.status.in_reply_to_user_id && + // no self-replies + attn.statusnet_profile_url !== this.status.user.statusnet_profile_url && + // don't include if mentions is written + !writtenSet.has(attn.statusnet_profile_url) }).map(attn => ({ url: attn.statusnet_profile_url, content: attn.screen_name,