diff options
author | Lorenz Diener <[email protected]> | 2017-09-08 16:34:11 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2017-09-08 16:34:11 +0200 |
commit | 517f47083d57d565ecd7e5145a401bbfcc6fbcda (patch) | |
tree | b694da2f0a509388085919ae9f5572ba7c33934e | |
parent | 84b463ce1dd843f23fee9ae1eb30f5f64ece6541 (diff) | |
download | mastodon.py-517f47083d57d565ecd7e5145a401bbfcc6fbcda.tar.gz |
Add conversation muting
-rw-r--r-- | docs/index.rst | 2 | ||||
-rw-r--r-- | 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. | |||
435 | .. automethod:: Mastodon.status_unreblog | 435 | .. automethod:: Mastodon.status_unreblog |
436 | .. automethod:: Mastodon.status_favourite | 436 | .. automethod:: Mastodon.status_favourite |
437 | .. automethod:: Mastodon.status_unfavourite | 437 | .. automethod:: Mastodon.status_unfavourite |
438 | .. automethod:: Mastodon.status_mute | ||
439 | .. automethod:: Mastodon.status_unmute | ||
438 | .. automethod:: Mastodon.status_delete | 440 | .. automethod:: Mastodon.status_delete |
439 | 441 | ||
440 | Writing data: Notifications | 442 | 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: | |||
585 | return self.__api_request('DELETE', url) | 585 | return self.__api_request('DELETE', url) |
586 | 586 | ||
587 | def status_reblog(self, id): | 587 | def status_reblog(self, id): |
588 | """Reblog a status. | 588 | """ |
589 | Reblog a status. | ||
589 | 590 | ||
590 | Returns a toot with with a new status that wraps around the reblogged one. | 591 | Returns a toot dict with a new status that wraps around the reblogged one. |
591 | """ | 592 | """ |
592 | url = '/api/v1/statuses/{0}/reblog'.format(str(id)) | 593 | url = '/api/v1/statuses/{0}/reblog'.format(str(id)) |
593 | return self.__api_request('POST', url) | 594 | return self.__api_request('POST', url) |
@@ -619,6 +620,24 @@ class Mastodon: | |||
619 | url = '/api/v1/statuses/{0}/unfavourite'.format(str(id)) | 620 | url = '/api/v1/statuses/{0}/unfavourite'.format(str(id)) |
620 | return self.__api_request('POST', url) | 621 | return self.__api_request('POST', url) |
621 | 622 | ||
623 | def status_mute(self, id): | ||
624 | """ | ||
625 | Mute notifications for a status. | ||
626 | |||
627 | Returns a toot dict with the now muted status | ||
628 | """ | ||
629 | url = '/api/v1/statuses/{0}/mute'.format(str(id)) | ||
630 | return self.__api_request('POST', url) | ||
631 | |||
632 | def status_unmute(self, id): | ||
633 | """ | ||
634 | Unmute notifications for a status. | ||
635 | |||
636 | Returns a toot dict with the status that used to be muted. | ||
637 | """ | ||
638 | url = '/api/v1/statuses/{0}/unmute'.format(str(id)) | ||
639 | return self.__api_request('POST', url) | ||
640 | |||
622 | ### | 641 | ### |
623 | # Writing data: Notifications | 642 | # Writing data: Notifications |
624 | ### | 643 | ### |