1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-09-22 04:25:55 -04:00

Fix version detection

Version check failed when the server sent something other than a number
as a version as happened on development version of the gotosocial
server.
This commit is contained in:
K 2023-01-19 09:32:45 +01:00 committed by GitHub
parent 0a6543d355
commit 4f9391f015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -336,7 +336,8 @@ class TUI(urwid.Frame):
# this works for Mastodon and Pleroma version strings
# Mastodon versions < 4 do not have translation service
# Revisit this logic if Pleroma implements translation
self.can_translate = int(instance["version"][0]) > 3
ch = instance["version"][0]
self.can_translate = int(ch) > 3 if ch.isnumeric() else False
return self.run_in_thread(_load_instance, done_callback=_done)