diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-08-08 10:09:07 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-08-08 10:09:07 +0000 |
| commit | 92380652feb83c6a4dde5ca3bac35ff4b409fa2d (patch) | |
| tree | 110677d061355c4641d1f661f9140d86b62acca1 /src/services/api/api.service.js | |
| parent | 17dc7357d5036681b346f745190204e213c0ef8c (diff) | |
| parent | d3f6b581d1bbe64d26fceae3f00e9d471ca44dfe (diff) | |
Merge branch 'feat/conversation-muting' into 'develop'
Add Conversation/Thread Muting
See merge request pleroma/pleroma-fe!876
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 84616dd1..083d4f4f 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -67,6 +67,8 @@ const MASTODON_PROFILE_UPDATE_URL = '/api/v1/accounts/update_credentials' const MASTODON_REPORT_USER_URL = '/api/v1/reports' const MASTODON_PIN_OWN_STATUS = id => `/api/v1/statuses/${id}/pin` const MASTODON_UNPIN_OWN_STATUS = id => `/api/v1/statuses/${id}/unpin` +const MASTODON_MUTE_CONVERSATION = id => `/api/v1/statuses/${id}/mute` +const MASTODON_UNMUTE_CONVERSATION = id => `/api/v1/statuses/${id}/unmute` const MASTODON_SEARCH_2 = `/api/v2/search` const MASTODON_USER_SEARCH_URL = '/api/v1/accounts/search' @@ -252,6 +254,16 @@ const unpinOwnStatus = ({ id, credentials }) => { .then((data) => parseStatus(data)) } +const muteConversation = ({ id, credentials }) => { + return promisedRequest({ url: MASTODON_MUTE_CONVERSATION(id), credentials, method: 'POST' }) + .then((data) => parseStatus(data)) +} + +const unmuteConversation = ({ id, credentials }) => { + return promisedRequest({ url: MASTODON_UNMUTE_CONVERSATION(id), credentials, method: 'POST' }) + .then((data) => parseStatus(data)) +} + const blockUser = ({ id, credentials }) => { return fetch(MASTODON_BLOCK_USER_URL(id), { headers: authHeaders(credentials), @@ -920,6 +932,8 @@ const apiService = { unfollowUser, pinOwnStatus, unpinOwnStatus, + muteConversation, + unmuteConversation, blockUser, unblockUser, fetchUser, |
