From 30eb63261ca5964222f5a2c5f03d6bd537fac987 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Fri, 11 Oct 2019 21:51:28 +0200 Subject: Implement new notification dismiss behaviour, add test for old behaviour --- mastodon/Mastodon.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mastodon') 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: self.__api_request('POST', '/api/v1/notifications/clear') - @api_version("1.3.0", "1.3.0", "1.3.0") + @api_version("1.3.0", "2.9.2", "2.9.2") def notifications_dismiss(self, id): """ Deletes a single notification """ id = self.__unpack_id(id) - params = self.__generate_params(locals()) - self.__api_request('POST', '/api/v1/notifications/dismiss', params) - + + if self.verify_minimum_version("2.9.2"): + url = '/api/v1/notifications/{0}/dismiss'.format(str(id)) + return self.__api_request('POST', '/api/v1/notifications/dismiss', params) + else: + params = self.__generate_params(locals()) + self.__api_request('POST', '/api/v1/notifications/dismiss', params) ### # Writing data: Conversations -- cgit v1.2.3