diff options
| author | rinpatch <rinpatch@sdf.org> | 2019-09-04 21:11:13 +0300 |
|---|---|---|
| committer | rinpatch <rinpatch@sdf.org> | 2019-09-04 21:11:13 +0300 |
| commit | 1a5a7bbebf45e93dbd47a99bb4eb05a5be5979f1 (patch) | |
| tree | dbac1ec5d0d69c7db57245d5d040741e0e6610cf | |
| parent | 66a34b7ecf65ded39882b9e4e7df9bbd2067afc3 (diff) | |
Set thread_muted for all statuses with the same conversation id on
status mute/unmute
| -rw-r--r-- | src/components/extra_buttons/extra_buttons.vue | 4 | ||||
| -rw-r--r-- | src/components/status/status.js | 2 | ||||
| -rw-r--r-- | src/modules/statuses.js | 10 | ||||
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 1 |
4 files changed, 10 insertions, 7 deletions
diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index ed0f3aa4..6781a4f8 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -10,14 +10,14 @@ <div slot="popover"> <div class="dropdown-menu"> <button - v-if="canMute && !status.muted" + v-if="canMute && !status.thread_muted" class="dropdown-item dropdown-item-icon" @click.prevent="muteConversation" > <i class="icon-eye-off" /><span>{{ $t("status.mute_conversation") }}</span> </button> <button - v-if="canMute && status.muted" + v-if="canMute && status.thread_muted" class="dropdown-item dropdown-item-icon" @click.prevent="unmuteConversation" > diff --git a/src/components/status/status.js b/src/components/status/status.js index d037f150..b72d2f58 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -117,7 +117,7 @@ const Status = { return hits }, - muted () { return !this.unmuted && (this.status.muted || this.muteWordHits.length > 0) }, + muted () { return !this.unmuted && (this.status.user.muted || this.status.thread_muted || this.muteWordHits.length > 0) }, hideFilteredStatuses () { return typeof this.$store.state.config.hideFilteredStatuses === 'undefined' ? this.$store.state.instance.hideFilteredStatuses diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 4356d0a7..9ba32976 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -426,9 +426,11 @@ export const mutations = { newStatus.favoritedBy.push(user) } }, - setMuted (state, status) { + setMutedStatus (state, status) { const newStatus = state.allStatusesObject[status.id] - newStatus.muted = status.muted + newStatus.thread_muted = status.thread_muted + + state.conversationsObject[newStatus.statusnet_conversation_id].forEach(status => { status.thread_muted = newStatus.thread_muted }) }, setRetweeted (state, { status, value }) { const newStatus = state.allStatusesObject[status.id] @@ -566,11 +568,11 @@ const statuses = { }, muteConversation ({ rootState, commit }, statusId) { return rootState.api.backendInteractor.muteConversation(statusId) - .then((status) => commit('setMuted', status)) + .then((status) => commit('setMutedStatus', status)) }, unmuteConversation ({ rootState, commit }, statusId) { return rootState.api.backendInteractor.unmuteConversation(statusId) - .then((status) => commit('setMuted', status)) + .then((status) => commit('setMutedStatus', status)) }, retweet ({ rootState, commit }, status) { // Optimistic retweeting... diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 6cc1851d..7438cd90 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -224,6 +224,7 @@ export const parseStatus = (data) => { output.statusnet_conversation_id = data.pleroma.conversation_id output.is_local = pleroma.local output.in_reply_to_screen_name = data.pleroma.in_reply_to_account_acct + output.thread_muted = pleroma.thread_muted } else { output.text = data.content output.summary = data.spoiler_text |
