aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 9a9b2d9..05c6f26 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -162,7 +162,7 @@ class Mastodon:
162 __DICT_VERSION_INSTANCE = bigger_version("2.3.0", __DICT_VERSION_ACCOUNT) 162 __DICT_VERSION_INSTANCE = bigger_version("2.3.0", __DICT_VERSION_ACCOUNT)
163 __DICT_VERSION_HASHTAG = "1.0.0" 163 __DICT_VERSION_HASHTAG = "1.0.0"
164 __DICT_VERSION_EMOJI = "2.1.0" 164 __DICT_VERSION_EMOJI = "2.1.0"
165 __DICT_VERSION_RELATIONSHIP = "1.4.0" 165 __DICT_VERSION_RELATIONSHIP = "2.3.4"
166 __DICT_VERSION_NOTIFICATION = bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) 166 __DICT_VERSION_NOTIFICATION = bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS)
167 __DICT_VERSION_CONTEXT = bigger_version("1.0.0", __DICT_VERSION_STATUS) 167 __DICT_VERSION_CONTEXT = bigger_version("1.0.0", __DICT_VERSION_STATUS)
168 __DICT_VERSION_LIST = "2.1.0" 168 __DICT_VERSION_LIST = "2.1.0"
@@ -1267,16 +1267,23 @@ class Mastodon:
1267 ### 1267 ###
1268 # Writing data: Accounts 1268 # Writing data: Accounts
1269 ### 1269 ###
1270 @api_version("1.0.0", "1.4.0", __DICT_VERSION_RELATIONSHIP) 1270 @api_version("1.0.0", "2.3.4", __DICT_VERSION_RELATIONSHIP)
1271 def account_follow(self, id): 1271 def account_follow(self, id, reblogs=True):
1272 """ 1272 """
1273 Follow a user. 1273 Follow a user.
1274 1274
1275 Set "reblogs" to False to hide boosts by the followed user.
1276
1275 Returns a `relationship dict`_ containing the updated relationship to the user. 1277 Returns a `relationship dict`_ containing the updated relationship to the user.
1276 """ 1278 """
1277 id = self.__unpack_id(id) 1279 id = self.__unpack_id(id)
1280 params = self.__generate_params(locals())
1281
1282 if params["reblogs"] == None:
1283 del params["reblogs"]
1284
1278 url = '/api/v1/accounts/{0}/follow'.format(str(id)) 1285 url = '/api/v1/accounts/{0}/follow'.format(str(id))
1279 return self.__api_request('POST', url) 1286 return self.__api_request('POST', url, params)
1280 1287
1281 @api_version("1.0.0", "2.1.0", __DICT_VERSION_ACCOUNT) 1288 @api_version("1.0.0", "2.1.0", __DICT_VERSION_ACCOUNT)
1282 def follows(self, uri): 1289 def follows(self, uri):
@@ -1321,11 +1328,14 @@ class Mastodon:
1321 url = '/api/v1/accounts/{0}/unblock'.format(str(id)) 1328 url = '/api/v1/accounts/{0}/unblock'.format(str(id))
1322 return self.__api_request('POST', url) 1329 return self.__api_request('POST', url)
1323 1330
1324 @api_version("1.1.0", "1.4.0", __DICT_VERSION_RELATIONSHIP) 1331 @api_version("1.1.0", "2.3.4", __DICT_VERSION_RELATIONSHIP)
1325 def account_mute(self, id): 1332 def account_mute(self, id, notifications=True):
1326 """ 1333 """
1327 Mute a user. 1334 Mute a user.
1328 1335
1336 Set "notifications" to False to receive notifications even though the user is
1337 muted from timelines.
1338
1329 Returns a `relationship dict`_ containing the updated relationship to the user. 1339 Returns a `relationship dict`_ containing the updated relationship to the user.
1330 """ 1340 """
1331 id = self.__unpack_id(id) 1341 id = self.__unpack_id(id)
Powered by cgit v1.2.3 (git 2.41.0)