aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-04-28 21:53:01 +0200
committerLorenz Diener <[email protected]>2019-04-28 21:53:01 +0200
commit3eba3f8835f25800f37b9da18a09429b084effa0 (patch)
tree112470e2ce3e07775c8963d7373892cbb8576058 /mastodon
parent66524ad4df9dcff3cee3a6d6bfc198e50ce310e1 (diff)
downloadmastodon.py-3eba3f8835f25800f37b9da18a09429b084effa0.tar.gz
Add preferences endpoint
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 3fe3d21..6b3de9a 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -180,6 +180,7 @@ class Mastodon:
180 __DICT_VERSION_FILTER = "2.4.3" 180 __DICT_VERSION_FILTER = "2.4.3"
181 __DICT_VERSION_CONVERSATION = bigger_version(bigger_version("2.6.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) 181 __DICT_VERSION_CONVERSATION = bigger_version(bigger_version("2.6.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS)
182 __DICT_VERSION_SCHEDULED_STATUS = bigger_version("2.7.0", __DICT_VERSION_STATUS) 182 __DICT_VERSION_SCHEDULED_STATUS = bigger_version("2.7.0", __DICT_VERSION_STATUS)
183 __DICT_VERSION_PREFERENCES = "2.8.0"
183 184
184 ### 185 ###
185 # Registering apps 186 # Registering apps
@@ -1350,6 +1351,20 @@ class Mastodon:
1350 return self.__api_request('GET', '/api/v1/push/subscription') 1351 return self.__api_request('GET', '/api/v1/push/subscription')
1351 1352
1352 ### 1353 ###
1354 # Reading data: Preferences
1355 ###
1356 @api_version("2.8.0", "2.8.0", __DICT_VERSION_PREFERENCES)
1357 def preferences(self):
1358 """
1359 Fetch the users preferences, which can be used to set some default options.
1360 As of 2.8.0, apps can only fetch, not update preferences.
1361
1362 Returns a `preference dict`_.
1363
1364 """
1365 return self.__api_request('GET', '/api/v1/preferences')
1366
1367 ###
1353 # Writing data: Statuses 1368 # Writing data: Statuses
1354 ### 1369 ###
1355 @api_version("1.0.0", "2.7.0", __DICT_VERSION_STATUS) 1370 @api_version("1.0.0", "2.7.0", __DICT_VERSION_STATUS)
Powered by cgit v1.2.3 (git 2.41.0)