diff options
author | Erin Congden <[email protected]> | 2017-04-02 20:53:32 -0700 |
---|---|---|
committer | Erin Congden <[email protected]> | 2017-04-02 21:53:25 -0700 |
commit | ca0b6c115bcb8f6b79b22f5ccd648a2d6b7d7fc5 (patch) | |
tree | 73230e27007bd901d639ae8be1a98ed14206727c /mastodon | |
parent | 38ebcda76bc0c264f8384f55c5b32bf049b2d6be (diff) | |
download | mastodon.py-ca0b6c115bcb8f6b79b22f5ccd648a2d6b7d7fc5.tar.gz |
Added follow requests support
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index d42c13f..06fe8a1 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -360,6 +360,18 @@ class Mastodon: | |||
360 | return self.__api_request('GET', '/api/v1/favourites') | 360 | return self.__api_request('GET', '/api/v1/favourites') |
361 | 361 | ||
362 | ### | 362 | ### |
363 | # Reading data: Follow requests | ||
364 | ### | ||
365 | def follow_requests(self, max_id = None, since_id = None, limit = None): | ||
366 | """ | ||
367 | Fetch the authenticated user's incoming follow requests. | ||
368 | |||
369 | Returns a list of user dicts. | ||
370 | """ | ||
371 | params = self.__generate_params(locals()) | ||
372 | return self.__api_request('GET', '/api/v1/follow_requests', params) | ||
373 | |||
374 | ### | ||
363 | # Writing data: Statuses | 375 | # Writing data: Statuses |
364 | ### | 376 | ### |
365 | def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None): | 377 | def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None): |
@@ -510,6 +522,25 @@ class Mastodon: | |||
510 | return self.__api_request('POST', '/api/v1/accounts/' + str(id) + "/unmute") | 522 | return self.__api_request('POST', '/api/v1/accounts/' + str(id) + "/unmute") |
511 | 523 | ||
512 | ### | 524 | ### |
525 | # Writing data: Follow requests | ||
526 | ### | ||
527 | def follow_request_authorize(self, id): | ||
528 | """ | ||
529 | Accept an incoming follow request. | ||
530 | |||
531 | Returns a user dict of the authorized account. | ||
532 | """ | ||
533 | return self.__api_request('POST', '/api/v1/follow_requests/' + str(id) + "/authorize") | ||
534 | |||
535 | def follow_request_reject(self, id): | ||
536 | """ | ||
537 | Reject an incoming follow request. | ||
538 | |||
539 | Returns a user dict of the rejected account. | ||
540 | """ | ||
541 | return self.__api_request('POST', '/api/v1/follow_requests/' + str(id) + "/reject") | ||
542 | |||
543 | ### | ||
513 | # Writing data: Media | 544 | # Writing data: Media |
514 | ### | 545 | ### |
515 | def media_post(self, media_file, mime_type = None): | 546 | def media_post(self, media_file, mime_type = None): |