From 897728189e9a95242f934f75e3ee572e7a2eb993 Mon Sep 17 00:00:00 2001 From: eris Date: Mon, 1 Aug 2022 02:50:58 +0000 Subject: [PATCH] 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 () {