From 6bb75a3a6d8452a3e1b88085fe87cf27386f222c Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 21 Apr 2020 23:27:51 +0300 Subject: make relationships separate from users --- src/components/status/status.js | 15 ++++++++++++--- src/components/status/status.vue | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src/components/status') diff --git a/src/components/status/status.js b/src/components/status/status.js index fc5956ec..a73e3ae2 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -118,7 +118,13 @@ const Status = { return hits }, - muted () { return !this.unmuted && ((!(this.inProfile && this.status.user.id === this.profileUserId) && this.status.user.muted) || (!this.inConversation && this.status.thread_muted) || this.muteWordHits.length > 0) }, + muted () { + const relationship = this.$store.state.users.relationships[this.status.user.id] || {} + return !this.unmuted && ( + (!(this.inProfile && this.status.user.id === this.profileUserId) && relationship.muting) || + (!this.inConversation && this.status.thread_muted) || + this.muteWordHits.length > 0) + }, hideFilteredStatuses () { return this.mergedConfig.hideFilteredStatuses }, @@ -178,8 +184,11 @@ const Status = { if (this.status.user.id === this.status.attentions[i].id) { continue } - const taggedUser = this.$store.getters.findUser(this.status.attentions[i].id) - if (checkFollowing && taggedUser && taggedUser.following) { + // There's zero guarantee of this working. If we happen to have that user and their + // relationship in store then it will work, but there's kinda little chance of having + // them for people you're not following. + const relationship = this.$store.state.users.relationships[this.status.attentions[i].id] + if (checkFollowing && relationship && relationship.following) { return false } if (this.status.attentions[i].id === this.currentUser.id) { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index ca295640..a04b501a 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -94,7 +94,7 @@