diff options
author | Lorenz Diener <[email protected]> | 2019-10-11 22:07:51 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2019-10-11 22:07:51 +0200 |
commit | f42032dafcefd422d3819ace721accf75f2d0c91 (patch) | |
tree | 8e4bf4efefbe351bbc85a981df29c8f94d6c884e /mastodon | |
parent | 17013f1d356f13004c66aed4181041f71c568b9e (diff) | |
download | mastodon.py-f42032dafcefd422d3819ace721accf75f2d0c91.tar.gz |
Add new card behaviour, freeze old test
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 91f5125..7f9a008 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -784,7 +784,7 @@ class Mastodon: | |||
784 | url = '/api/v1/statuses/{0}'.format(str(id)) | 784 | url = '/api/v1/statuses/{0}'.format(str(id)) |
785 | return self.__api_request('GET', url) | 785 | return self.__api_request('GET', url) |
786 | 786 | ||
787 | @api_version("1.0.0", "1.0.0", __DICT_VERSION_CARD) | 787 | @api_version("1.0.0", "3.0.0", __DICT_VERSION_CARD) |
788 | def status_card(self, id): | 788 | def status_card(self, id): |
789 | """ | 789 | """ |
790 | Fetch a card associated with a status. A card describes an object (such as an | 790 | Fetch a card associated with a status. A card describes an object (such as an |
@@ -792,11 +792,19 @@ class Mastodon: | |||
792 | 792 | ||
793 | Does not require authentication for publicly visible statuses. | 793 | Does not require authentication for publicly visible statuses. |
794 | 794 | ||
795 | This function is deprecated as of 3.0.0 and the endpoint does not | ||
796 | exist anymore - you should just use the "card" field of the status dicts | ||
797 | instead. Mastodon.py will try to mimick the old behaviour, but this | ||
798 | is somewhat inefficient and not guaranteed to be the case forever. | ||
799 | |||
795 | Returns a `card dict`_. | 800 | Returns a `card dict`_. |
796 | """ | 801 | """ |
797 | id = self.__unpack_id(id) | 802 | if self.verify_minimum_version("3.0.0"): |
798 | url = '/api/v1/statuses/{0}/card'.format(str(id)) | 803 | return self.status(id).card |
799 | return self.__api_request('GET', url) | 804 | else: |
805 | id = self.__unpack_id(id) | ||
806 | url = '/api/v1/statuses/{0}/card'.format(str(id)) | ||
807 | return self.__api_request('GET', url) | ||
800 | 808 | ||
801 | @api_version("1.0.0", "1.0.0", __DICT_VERSION_CONTEXT) | 809 | @api_version("1.0.0", "1.0.0", __DICT_VERSION_CONTEXT) |
802 | def status_context(self, id): | 810 | def status_context(self, id): |