From 7df35c4807f084bb71e67d1da155d92baa46d3f2 Mon Sep 17 00:00:00 2001 From: "@brrzap" Date: Sun, 14 May 2017 01:24:46 -0400 Subject: expand notifications/favourites/blocks/mutes arguments * adds max_id, since_id, limit parameters to existing functions --- mastodon/Mastodon.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'mastodon') diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 3b00f37..c1027a2 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -320,7 +320,7 @@ class Mastodon: ### # Reading data: Notifications ### - def notifications(self, id = None): + def notifications(self, id = None, max_id = None, since_id = None, limit = None): """ Fetch notifications (mentions, favourites, reblogs, follows) for the authenticated user. @@ -330,7 +330,8 @@ class Mastodon: Returns a list of notification dicts. """ if id == None: - return self.__api_request('GET', '/api/v1/notifications') + params = self.__generate_params(locals(), ['id']) + return self.__api_request('GET', '/api/v1/notifications', params) else: return self.__api_request('GET', '/api/v1/notifications/' + str(id)) @@ -416,21 +417,23 @@ class Mastodon: ### # Reading data: Mutes and Blocks ### - def mutes(self): + def mutes(self, max_id = None, since_id = None, limit = None): """ Fetch a list of users muted by the authenticated user. Returns a list of user dicts. """ - return self.__api_request('GET', '/api/v1/mutes') + params = self.__generate_params(locals()) + return self.__api_request('GET', '/api/v1/mutes', params) - def blocks(self): + def blocks(self, max_id = None, since_id = None, limit = None): """ Fetch a list of users blocked by the authenticated user. Returns a list of user dicts. """ - return self.__api_request('GET', '/api/v1/blocks') + params = self.__generate_params(locals()) + return self.__api_request('GET', '/api/v1/blocks', params) ### # Reading data: Reports @@ -446,13 +449,14 @@ class Mastodon: ### # Reading data: Favourites ### - def favourites(self): + def favourites(self, max_id = None, since_id = None, limit = None): """ Fetch the authenticated user's favourited statuses. Returns a list of toot dicts. """ - return self.__api_request('GET', '/api/v1/favourites') + params = self.__generate_params(locals()) + return self.__api_request('GET', '/api/v1/favourites', params) ### # Reading data: Follow requests -- cgit v1.2.3