diff options
| author | Tarteka <info@tarteka.net> | 2019-10-30 22:17:19 +0100 |
|---|---|---|
| committer | Tarteka <info@tarteka.net> | 2019-10-30 22:17:19 +0100 |
| commit | fe4845a7c1ca9d6fa51132a0ef9bc5103facae66 (patch) | |
| tree | 92aceb88e58d149a5446e5a9d7bca6084cb6fa99 /src/modules/users.js | |
| parent | a178346f1e0fbe2246532bbfeba5fd1cc0c1cb2d (diff) | |
| parent | 74f5f168d639e9e21e294ac45dd6091694a041cc (diff) | |
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma-fe into develop
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index 4d02f8d7..6d259dc2 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -60,6 +60,18 @@ const unmuteUser = (store, id) => { .then((relationship) => store.commit('updateUserRelationship', [relationship])) } +const hideReblogs = (store, userId) => { + return store.rootState.api.backendInteractor.followUser({ id: userId, reblogs: false }) + .then((relationship) => { + store.commit('updateUserRelationship', [relationship]) + }) +} + +const showReblogs = (store, userId) => { + return store.rootState.api.backendInteractor.followUser({ id: userId, reblogs: true }) + .then((relationship) => store.commit('updateUserRelationship', [relationship])) +} + export const mutations = { setMuted (state, { user: { id }, muted }) { const user = state.usersObject[id] @@ -135,6 +147,7 @@ export const mutations = { user.muted = relationship.muting user.statusnet_blocking = relationship.blocking user.subscribed = relationship.subscribing + user.showing_reblogs = relationship.showing_reblogs } }) }, @@ -272,6 +285,12 @@ const users = { unmuteUser (store, id) { return unmuteUser(store, id) }, + hideReblogs (store, id) { + return hideReblogs(store, id) + }, + showReblogs (store, id) { + return showReblogs(store, id) + }, muteUsers (store, ids = []) { return Promise.all(ids.map(id => muteUser(store, id))) }, |
