diff options
| author | Tusooa Zhu <tusooa@kazv.moe> | 2022-04-30 11:08:19 -0400 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2023-01-20 23:40:11 -0500 |
| commit | 228a9afdf5ecc10a17de31f88bd88ad1efbe0004 (patch) | |
| tree | de4b33705c4e9b4f3fb12f6c5ad26b08f8261566 /src/modules/users.js | |
| parent | 95c15fca225d989613a50a6039c8ffa809a8fd88 (diff) | |
Add timed-mute functionality
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index 053e44b6..a1316ba2 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -61,13 +61,16 @@ const editUserNote = (store, { id, comment }) => { .then((relationship) => store.commit('updateUserRelationship', [relationship])) } -const muteUser = (store, id) => { +const muteUser = (store, args) => { + const id = typeof args === 'object' ? args.id : args + const expiresIn = typeof args === 'object' ? args.expiresIn : 0 + const predictedRelationship = store.state.relationships[id] || { id } predictedRelationship.muting = true store.commit('updateUserRelationship', [predictedRelationship]) store.commit('addMuteId', id) - return store.rootState.api.backendInteractor.muteUser({ id }) + return store.rootState.api.backendInteractor.muteUser({ id, expiresIn }) .then((relationship) => { store.commit('updateUserRelationship', [relationship]) store.commit('addMuteId', id) |
