Merge pull request #53 from brrzap/expand-params
expand parameters in notifications/favourites/blocks/mutes
This commit is contained in:
commit
5ed78fbe83
S'han modificat 1 arxius amb 12 adicions i 8 eliminacions
|
@ -320,7 +320,7 @@ class Mastodon:
|
||||||
###
|
###
|
||||||
# Reading data: Notifications
|
# 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
|
Fetch notifications (mentions, favourites, reblogs, follows) for the authenticated
|
||||||
user.
|
user.
|
||||||
|
@ -330,7 +330,8 @@ class Mastodon:
|
||||||
Returns a list of notification dicts.
|
Returns a list of notification dicts.
|
||||||
"""
|
"""
|
||||||
if id == None:
|
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:
|
else:
|
||||||
return self.__api_request('GET', '/api/v1/notifications/' + str(id))
|
return self.__api_request('GET', '/api/v1/notifications/' + str(id))
|
||||||
|
|
||||||
|
@ -416,21 +417,23 @@ class Mastodon:
|
||||||
###
|
###
|
||||||
# Reading data: Mutes and Blocks
|
# 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.
|
Fetch a list of users muted by the authenticated user.
|
||||||
|
|
||||||
Returns a list of user dicts.
|
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.
|
Fetch a list of users blocked by the authenticated user.
|
||||||
|
|
||||||
Returns a list of user dicts.
|
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
|
# Reading data: Reports
|
||||||
|
@ -446,13 +449,14 @@ class Mastodon:
|
||||||
###
|
###
|
||||||
# Reading data: Favourites
|
# Reading data: Favourites
|
||||||
###
|
###
|
||||||
def favourites(self):
|
def favourites(self, max_id = None, since_id = None, limit = None):
|
||||||
"""
|
"""
|
||||||
Fetch the authenticated user's favourited statuses.
|
Fetch the authenticated user's favourited statuses.
|
||||||
|
|
||||||
Returns a list of toot dicts.
|
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
|
# Reading data: Follow requests
|
||||||
|
|
Loading…
Referencia en una nova incidència