mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user