From 517f47083d57d565ecd7e5145a401bbfcc6fbcda Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Fri, 8 Sep 2017 16:34:11 +0200 Subject: [PATCH] Add conversation muting --- docs/index.rst | 2 ++ mastodon/Mastodon.py | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index ae0a3ad..11b655a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -435,6 +435,8 @@ interact with already posted statuses. .. automethod:: Mastodon.status_unreblog .. automethod:: Mastodon.status_favourite .. automethod:: Mastodon.status_unfavourite +.. automethod:: Mastodon.status_mute +.. automethod:: Mastodon.status_unmute .. automethod:: Mastodon.status_delete Writing data: Notifications diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 1dfba7a..1e1d90e 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -585,9 +585,10 @@ class Mastodon: return self.__api_request('DELETE', url) def status_reblog(self, id): - """Reblog a status. + """ + Reblog a status. - Returns a toot with with a new status that wraps around the reblogged one. + Returns a toot dict with a new status that wraps around the reblogged one. """ url = '/api/v1/statuses/{0}/reblog'.format(str(id)) return self.__api_request('POST', url) @@ -619,6 +620,24 @@ class Mastodon: url = '/api/v1/statuses/{0}/unfavourite'.format(str(id)) return self.__api_request('POST', url) + def status_mute(self, id): + """ + Mute notifications for a status. + + Returns a toot dict with the now muted status + """ + url = '/api/v1/statuses/{0}/mute'.format(str(id)) + return self.__api_request('POST', url) + + def status_unmute(self, id): + """ + Unmute notifications for a status. + + Returns a toot dict with the status that used to be muted. + """ + url = '/api/v1/statuses/{0}/unmute'.format(str(id)) + return self.__api_request('POST', url) + ### # Writing data: Notifications ###