aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author@brrzap <[email protected]>2017-05-14 01:24:46 -0400
committer@brrzap <[email protected]>2017-05-14 01:24:46 -0400
commit7df35c4807f084bb71e67d1da155d92baa46d3f2 (patch)
tree9549270542414172b4669f65af6fb1571d5edf31
parent893ff2e1348d3be512f27120ae3fd1ef55fadb95 (diff)
downloadmastodon.py-7df35c4807f084bb71e67d1da155d92baa46d3f2.tar.gz
expand notifications/favourites/blocks/mutes arguments
* adds max_id, since_id, limit parameters to existing functions
-rw-r--r--mastodon/Mastodon.py20
1 files changed, 12 insertions, 8 deletions
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:
320 ### 320 ###
321 # Reading data: Notifications 321 # Reading data: Notifications
322 ### 322 ###
323 def notifications(self, id = None): 323 def notifications(self, id = None, max_id = None, since_id = None, limit = None):
324 """ 324 """
325 Fetch notifications (mentions, favourites, reblogs, follows) for the authenticated 325 Fetch notifications (mentions, favourites, reblogs, follows) for the authenticated
326 user. 326 user.
@@ -330,7 +330,8 @@ class Mastodon:
330 Returns a list of notification dicts. 330 Returns a list of notification dicts.
331 """ 331 """
332 if id == None: 332 if id == None:
333 return self.__api_request('GET', '/api/v1/notifications') 333 params = self.__generate_params(locals(), ['id'])
334 return self.__api_request('GET', '/api/v1/notifications', params)
334 else: 335 else:
335 return self.__api_request('GET', '/api/v1/notifications/' + str(id)) 336 return self.__api_request('GET', '/api/v1/notifications/' + str(id))
336 337
@@ -416,21 +417,23 @@ class Mastodon:
416 ### 417 ###
417 # Reading data: Mutes and Blocks 418 # Reading data: Mutes and Blocks
418 ### 419 ###
419 def mutes(self): 420 def mutes(self, max_id = None, since_id = None, limit = None):
420 """ 421 """
421 Fetch a list of users muted by the authenticated user. 422 Fetch a list of users muted by the authenticated user.
422 423
423 Returns a list of user dicts. 424 Returns a list of user dicts.
424 """ 425 """
425 return self.__api_request('GET', '/api/v1/mutes') 426 params = self.__generate_params(locals())
427 return self.__api_request('GET', '/api/v1/mutes', params)
426 428
427 def blocks(self): 429 def blocks(self, max_id = None, since_id = None, limit = None):
428 """ 430 """
429 Fetch a list of users blocked by the authenticated user. 431 Fetch a list of users blocked by the authenticated user.
430 432
431 Returns a list of user dicts. 433 Returns a list of user dicts.
432 """ 434 """
433 return self.__api_request('GET', '/api/v1/blocks') 435 params = self.__generate_params(locals())
436 return self.__api_request('GET', '/api/v1/blocks', params)
434 437
435 ### 438 ###
436 # Reading data: Reports 439 # Reading data: Reports
@@ -446,13 +449,14 @@ class Mastodon:
446 ### 449 ###
447 # Reading data: Favourites 450 # Reading data: Favourites
448 ### 451 ###
449 def favourites(self): 452 def favourites(self, max_id = None, since_id = None, limit = None):
450 """ 453 """
451 Fetch the authenticated user's favourited statuses. 454 Fetch the authenticated user's favourited statuses.
452 455
453 Returns a list of toot dicts. 456 Returns a list of toot dicts.
454 """ 457 """
455 return self.__api_request('GET', '/api/v1/favourites') 458 params = self.__generate_params(locals())
459 return self.__api_request('GET', '/api/v1/favourites', params)
456 460
457 ### 461 ###
458 # Reading data: Follow requests 462 # Reading data: Follow requests
Powered by cgit v1.2.3 (git 2.41.0)