aboutsummaryrefslogtreecommitdiff
path: root/src/services/api/api.service.js
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2019-07-07 23:02:09 +0300
committershpuld <shp@cock.li>2019-07-07 23:02:09 +0300
commit7ed9d17ce745abc38a27d4994452a136357aba46 (patch)
tree78d626fc8cea0b316440f62e5e02a1de2d66e228 /src/services/api/api.service.js
parent54b0f9013388b24769c587abbf7ca76849ce9570 (diff)
Add thread muting to context menu of status
Diffstat (limited to 'src/services/api/api.service.js')
-rw-r--r--src/services/api/api.service.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 22db671e..5bce85a3 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -65,6 +65,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 oldfetch = window.fetch
@@ -244,6 +246,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),
@@ -850,6 +862,8 @@ const apiService = {
unfollowUser,
pinOwnStatus,
unpinOwnStatus,
+ muteConversation,
+ unmuteConversation,
blockUser,
unblockUser,
fetchUser,