aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2019-09-20 15:23:13 +0000
committerShpuld Shpludson <shp@cock.li>2019-09-20 15:23:13 +0000
commitdcef84363ff0656940d095d2c010ca13252000e8 (patch)
tree9e92df60075bee0285e6b34d8b433cb6065f3b3f /src
parent9b163d281670e0c0a589adce46727284fbcba0ad (diff)
parent1306fac38f46b5578d46cc6abd6168a3399886b1 (diff)
Merge branch 'muting-fixes' into 'develop'
Properly detect thread-muted posts and set `with_muted` when fetching notifications See merge request pleroma/pleroma-fe!941
Diffstat (limited to 'src')
-rw-r--r--src/components/extra_buttons/extra_buttons.vue4
-rw-r--r--src/modules/statuses.js12
-rw-r--r--src/services/notifications_fetcher/notifications_fetcher.service.js5
3 files changed, 15 insertions, 6 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/modules/statuses.js b/src/modules/statuses.js
index 4356d0a7..918065d2 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -426,9 +426,13 @@ 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
+
+ if (newStatus.thread_muted !== undefined) {
+ 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 +570,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/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js
index f9ec3f6e..b6c4cf80 100644
--- a/src/services/notifications_fetcher/notifications_fetcher.service.js
+++ b/src/services/notifications_fetcher/notifications_fetcher.service.js
@@ -10,6 +10,11 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => {
const args = { credentials }
const rootState = store.rootState || store.state
const timelineData = rootState.statuses.notifications
+ const hideMutedPosts = typeof rootState.config.hideMutedPosts === 'undefined'
+ ? rootState.instance.hideMutedPosts
+ : rootState.config.hideMutedPosts
+
+ args['withMuted'] = !hideMutedPosts
args['timeline'] = 'notifications'
if (older) {