From 3eba3f8835f25800f37b9da18a09429b084effa0 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 28 Apr 2019 21:53:01 +0200 Subject: Add preferences endpoint --- mastodon/Mastodon.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mastodon/Mastodon.py') 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: __DICT_VERSION_FILTER = "2.4.3" __DICT_VERSION_CONVERSATION = bigger_version(bigger_version("2.6.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) __DICT_VERSION_SCHEDULED_STATUS = bigger_version("2.7.0", __DICT_VERSION_STATUS) + __DICT_VERSION_PREFERENCES = "2.8.0" ### # Registering apps @@ -1349,6 +1350,20 @@ class Mastodon: """ return self.__api_request('GET', '/api/v1/push/subscription') + ### + # Reading data: Preferences + ### + @api_version("2.8.0", "2.8.0", __DICT_VERSION_PREFERENCES) + def preferences(self): + """ + Fetch the users preferences, which can be used to set some default options. + As of 2.8.0, apps can only fetch, not update preferences. + + Returns a `preference dict`_. + + """ + return self.__api_request('GET', '/api/v1/preferences') + ### # Writing data: Statuses ### -- cgit v1.2.3