diff options
Diffstat (limited to 'mastodon/internals.py')
-rw-r--r-- | mastodon/internals.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mastodon/internals.py b/mastodon/internals.py index 415e22d..4ee2c5b 100644 --- a/mastodon/internals.py +++ b/mastodon/internals.py | |||
@@ -656,3 +656,14 @@ class Mastodon(): | |||
656 | elif base_url.startswith("https://") or base_url.startswith("onion://"): | 656 | elif base_url.startswith("https://") or base_url.startswith("onion://"): |
657 | base_url = base_url[8:] | 657 | base_url = base_url[8:] |
658 | return base_url | 658 | return base_url |
659 | |||
660 | def __normalize_version_string(self, version_string): | ||
661 | # Split off everything after the first space, to take care of Pleromalikes so that the parser doesn't get confused in case those have a + somewhere in their version | ||
662 | version_string = version_string.split(" ")[0] | ||
663 | try: | ||
664 | # Attempt to split at + and check if the part after parses as a version string, to account for hometown | ||
665 | parse_version_string(version_string.split("+")[1]) | ||
666 | return version_string.split("+")[1] | ||
667 | except: | ||
668 | # If this fails, assume that if there is a +, what is before that is the masto version (or that there is no +) | ||
669 | return version_string.split("+")[0] \ No newline at end of file | ||