aboutsummaryrefslogtreecommitdiff
path: root/src/components/status/status.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-08-15 16:27:41 +0300
committerHenry Jameson <me@hjkos.com>2021-08-15 16:27:41 +0300
commit17d2eed06a7c0c2a38129e36cca1e676c351abce (patch)
tree2521a727071db6f7cfe4e76f7e227dfe69b750d6 /src/components/status/status.js
parentb67db47c888dd45c49a49b82e7922c2bf40ed61c (diff)
parentf16658adfc897a3b07ed7f79d872acd2c3837cc8 (diff)
Merge branch 'better-still-emoji' into proper-attachments
* better-still-emoji: fix tests prevent infinite update loops remove obsolete tests removed useless code, review change, fixed bug with tall statuses fixed mentions line again remove old emoji added, everything emoji-bearing uses RichContent now richcontent support in polls, user cards and user profiles support richcontent in polls fix tests, add performance test (skipped, doesn't assert anything), tweak max mentions count made the code responsible for showing unwritten mentions actually work remove new options for style and separate line, now groups all chained mentions on a mentionsline regardless of placement. fixes spacing fix tests
Diffstat (limited to 'src/components/status/status.js')
-rw-r--r--src/components/status/status.js25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 3c21cb76..ac481534 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -166,29 +166,22 @@ const Status = {
muteWordHits () {
return muteWordHits(this.status, this.muteWords)
},
- mentions () {
+ mentionsLine () {
+ 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
+ // 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,
userId: attn.id
}))
},
- alsoMentions () {
- if (!this.headTailLinks) return []
- const set = new Set(this.headTailLinks.writtenMentions.map(m => m.url))
- return this.headTailLinks.writtenMentions.filter(mention => {
- return !set.has(mention.url)
- })
- },
- mentionsLine () {
- return this.mentionsOwnLine ? this.mentions : this.alsoMentions
- },
- mentionsOwnLine () {
- return this.mergedConfig.mentionsOwnLine
- },
hasMentionsLine () {
return this.mentionsLine.length > 0
},