diff options
| author | kaniini <nenolod@gmail.com> | 2018-08-24 23:00:56 +0000 |
|---|---|---|
| committer | kaniini <nenolod@gmail.com> | 2018-08-24 23:00:56 +0000 |
| commit | fe906cc3f0c8388bcb2a33be9c72ca5365bde0a5 (patch) | |
| tree | a92128b2779b3971d15699b4410c37687446d480 /src/components/status/status.js | |
| parent | 13acdc4a00f7c4e8487de0c95fe69ff110f13e6e (diff) | |
| parent | 55650ff7ea9867cdb8adf7077b36bbb8c7bfcb75 (diff) | |
Merge branch 'develop' into 'notifications'
# Conflicts:
# src/main.js
Diffstat (limited to 'src/components/status/status.js')
| -rw-r--r-- | src/components/status/status.js | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 9670f69d..11b8feba 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -83,7 +83,6 @@ const Status = { return hits }, muted () { return !this.unmuted && (this.status.user.muted || this.muteWordHits.length > 0) }, - isReply () { return !!this.status.in_reply_to_status_id }, isFocused () { // retweet or root of an expanded conversation if (this.focused) { @@ -105,6 +104,48 @@ const Status = { const lengthScore = this.status.statusnet_html.split(/<p|<br/).length + this.status.text.length / 80 return lengthScore > 20 }, + isReply () { + if (this.status.in_reply_to_status_id) { + return true + } + // For private replies where we can't see the OP, in_reply_to_status_id will be null. + // So instead, check that the post starts with a @mention. + if (this.status.visibility === 'private') { + var textBody = this.status.text + if (this.status.summary !== null) { + textBody = textBody.substring(this.status.summary.length, textBody.length) + } + return textBody.startsWith('@') + } + return false + }, + hideReply () { + if (this.$store.state.config.replyVisibility === 'all') { + return false + } + if (this.inlineExpanded || this.expanded || this.inConversation || !this.isReply) { + return false + } + if (this.status.user.id === this.$store.state.users.currentUser.id) { + return false + } + if (this.status.activity_type === 'repeat') { + return false + } + var checkFollowing = this.$store.state.config.replyVisibility === 'following' + for (var i = 0; i < this.status.attentions.length; ++i) { + if (this.status.user.id === this.status.attentions[i].id) { + continue + } + if (checkFollowing && this.status.attentions[i].following) { + return false + } + if (this.status.attentions[i].id === this.$store.state.users.currentUser.id) { + return false + } + } + return this.status.attentions.length > 0 + }, hideSubjectStatus () { if (this.tallStatus && !this.$store.state.config.collapseMessageWithSubject) { return false |
