diff options
author | Lorenz Diener <[email protected]> | 2017-05-19 10:08:57 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2017-05-19 10:08:57 +0200 |
commit | 5ed78fbe8372bc9e87968a2f42031859190df8db (patch) | |
tree | 32a7f4a5ccdbbefc3aff6696c6e482f07b52dc90 /mastodon | |
parent | 3031906743e995030ee59e6d99d417d2363b3ab4 (diff) | |
parent | 7df35c4807f084bb71e67d1da155d92baa46d3f2 (diff) | |
download | mastodon.py-5ed78fbe8372bc9e87968a2f42031859190df8db.tar.gz |
Merge pull request #53 from brrzap/expand-params
expand parameters in notifications/favourites/blocks/mutes
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 5c6c085..ce7e1d0 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 |