aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2018-07-30 15:16:46 +0200
committerLorenz Diener <[email protected]>2018-07-30 15:16:46 +0200
commitda859de4571ded886f7275b3ecbe311ebec7e239 (patch)
treef8832c495cb6c7bfc0b6829551173111f2bbf461
parent1a6293db4431ff811b005be9bc7109aa1279f022 (diff)
downloadmastodon.py-da859de4571ded886f7275b3ecbe311ebec7e239.tar.gz
Muting / Hide Reblogs changes
-rw-r--r--docs/index.rst4
-rw-r--r--mastodon/Mastodon.py22
2 files changed, 20 insertions, 6 deletions
diff --git a/docs/index.rst b/docs/index.rst
index c930523..ad6584e 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -338,10 +338,14 @@ Relationship dicts
338 'followed_by': # Boolean denoting whether the specified user follows the logged-in user 338 'followed_by': # Boolean denoting whether the specified user follows the logged-in user
339 'blocking': # Boolean denoting whether the logged-in user has blocked the specified user 339 'blocking': # Boolean denoting whether the logged-in user has blocked the specified user
340 'muting': # Boolean denoting whether the logged-in user has muted the specified user 340 'muting': # Boolean denoting whether the logged-in user has muted the specified user
341 'muting_notifications': # Boolean denoting wheter the logged-in user has muted notifications
342 # related to the specified user
341 'requested': # Boolean denoting whether the logged-in user has sent the specified 343 'requested': # Boolean denoting whether the logged-in user has sent the specified
342 # user a follow request 344 # user a follow request
343 'domain_blocking': # Boolean denoting whether the logged-in user has blocked the 345 'domain_blocking': # Boolean denoting whether the logged-in user has blocked the
344 # specified users domain 346 # specified users domain
347 'showing_reblogs': # Boolean denoting whether the specified users reblogs show up on the
348 # logged-in users Timeline
345 } 349 }
346 350
347Notification dicts 351Notification dicts
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)