From ca0b6c115bcb8f6b79b22f5ccd648a2d6b7d7fc5 Mon Sep 17 00:00:00 2001 From: Erin Congden Date: Sun, 2 Apr 2017 20:53:32 -0700 Subject: Added follow requests support --- mastodon/Mastodon.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'mastodon') diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index d42c13f..06fe8a1 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -359,6 +359,18 @@ class Mastodon: """ return self.__api_request('GET', '/api/v1/favourites') + ### + # Reading data: Follow requests + ### + def follow_requests(self, max_id = None, since_id = None, limit = None): + """ + Fetch the authenticated user's incoming follow requests. + + Returns a list of user dicts. + """ + params = self.__generate_params(locals()) + return self.__api_request('GET', '/api/v1/follow_requests', params) + ### # Writing data: Statuses ### @@ -509,6 +521,25 @@ class Mastodon: """ return self.__api_request('POST', '/api/v1/accounts/' + str(id) + "/unmute") + ### + # Writing data: Follow requests + ### + def follow_request_authorize(self, id): + """ + Accept an incoming follow request. + + Returns a user dict of the authorized account. + """ + return self.__api_request('POST', '/api/v1/follow_requests/' + str(id) + "/authorize") + + def follow_request_reject(self, id): + """ + Reject an incoming follow request. + + Returns a user dict of the rejected account. + """ + return self.__api_request('POST', '/api/v1/follow_requests/' + str(id) + "/reject") + ### # Writing data: Media ### -- cgit v1.2.3