From d49884a76f0a1e221fea2105be50bab32ebb120e Mon Sep 17 00:00:00 2001 From: eris Date: Mon, 1 Aug 2022 02:50:58 +0000 Subject: [PATCH 1/2] Hide replies to muted users --- src/components/status/status.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index a8bc4153..434668e2 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -277,6 +277,22 @@ const Status = { return mentions }, + mentionsMutedUser () { + // XXX: doesn't work on domain blocks, because users from blocked domains + // don't appear in `attentions' and therefore cannot be filtered. + let mentions = false + + // find if user in mentions list is blocked + this.status.attentions.forEach((attn) => { + if (attn.id === this.currentUser.id) return + const relationship = this.$store.getters.relationship(attn.id) + if (relationship.muting) { + mentions = true + } + }) + + return mentions + }, muted () { if (this.statusoid.user.id === this.currentUser.id) return false const reasonsToMute = this.userIsMuted || @@ -287,7 +303,9 @@ const Status = { // bot status (this.muteBotStatuses && this.botStatus && !this.compact) || // mentions blocked user - this.mentionsBlockedUser + this.mentionsBlockedUser || + // mentions muted user + this.mentionsMutedUser return !this.unmuted && !this.shouldNotMute && reasonsToMute }, userIsMuted () { -- 2.43.0 From f951bc436e9cc763a26987b355b85c7d5156504f Mon Sep 17 00:00:00 2001 From: eris Date: Mon, 1 Aug 2022 05:57:46 +0000 Subject: [PATCH 2/2] Hide muted replies if muted threads enabled --- src/components/status/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 434668e2..2959c3fd 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -358,7 +358,7 @@ const Status = { return (!this.shouldNotMute) && ( (this.muted && this.hideFilteredStatuses) || (this.userIsMuted && this.hideMutedUsers) || - (this.status.thread_muted && this.hideMutedThreads) || + ((this.status.thread_muted || this.mentionsMutedUser) && this.hideMutedThreads) || (this.muteWordHits.length > 0 && this.hideWordFilteredPosts) || (this.mentionsBlockedUser && this.hideThreadsWithBlockedUsers) ) -- 2.43.0