panels: Show a banner for users with legacy desktop apps.

Users who are using ZulipDesktop or haven't managed to auto-update to
ZulipElectron should be strongly encouraged to upgrade.

We'll likely want to move to something even stricter that blocks
loading the app at all, but this is a good start.
This commit is contained in:
Tim Abbott
2020-02-28 00:55:29 -08:00
parent 7db3d4560f
commit d79a7a8c35
6 changed files with 40 additions and 1 deletions

View File

@@ -87,3 +87,17 @@ def check_global_compatibility(request: HttpRequest) -> HttpResponse:
and version_lt(user_agent['version'], android_min_app_version)):
return json_error(legacy_compatibility_error_message)
return json_success()
def is_outdated_desktop_app(user_agent_str: str) -> bool:
user_agent = parse_user_agent(user_agent_str)
if user_agent['name'] == 'ZulipDesktop':
# The deprecated QT/webkit based desktop app, last updated in ~2016.
return True
if user_agent['name'] == 'ZulipElectron' and version_lt(user_agent['version'], '4.0.0'):
# Versions of the modern Electron-based Zulip desktop app with
# known security issues. Versions before 2.3.82 won't
# auto-update; we may want a special notice to distinguish
# those from modern releases.
return True
return False