diff options
author | Lorenz Diener <[email protected]> | 2019-10-11 21:51:28 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2019-10-11 21:51:28 +0200 |
commit | 30eb63261ca5964222f5a2c5f03d6bd537fac987 (patch) | |
tree | 9bc3b796f91c6b3cdabfa1ca386cb2d4b8213469 /mastodon | |
parent | ec58bd4de87c727d6fd8c71cc8f0d1bb312feae1 (diff) | |
download | mastodon.py-30eb63261ca5964222f5a2c5f03d6bd537fac987.tar.gz |
Implement new notification dismiss behaviour, add test for old behaviour
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index b34e9d4..91f5125 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1795,15 +1795,19 @@ class Mastodon: | |||
1795 | self.__api_request('POST', '/api/v1/notifications/clear') | 1795 | self.__api_request('POST', '/api/v1/notifications/clear') |
1796 | 1796 | ||
1797 | 1797 | ||
1798 | @api_version("1.3.0", "1.3.0", "1.3.0") | 1798 | @api_version("1.3.0", "2.9.2", "2.9.2") |
1799 | def notifications_dismiss(self, id): | 1799 | def notifications_dismiss(self, id): |
1800 | """ | 1800 | """ |
1801 | Deletes a single notification | 1801 | Deletes a single notification |
1802 | """ | 1802 | """ |
1803 | id = self.__unpack_id(id) | 1803 | id = self.__unpack_id(id) |
1804 | params = self.__generate_params(locals()) | 1804 | |
1805 | self.__api_request('POST', '/api/v1/notifications/dismiss', params) | 1805 | if self.verify_minimum_version("2.9.2"): |
1806 | 1806 | url = '/api/v1/notifications/{0}/dismiss'.format(str(id)) | |
1807 | return self.__api_request('POST', '/api/v1/notifications/dismiss', params) | ||
1808 | else: | ||
1809 | params = self.__generate_params(locals()) | ||
1810 | self.__api_request('POST', '/api/v1/notifications/dismiss', params) | ||
1807 | 1811 | ||
1808 | ### | 1812 | ### |
1809 | # Writing data: Conversations | 1813 | # Writing data: Conversations |