Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

zilencer: Handle very old server push notifications.

Alex Vandiverba97611a8b6a
diff --git a/zilencer/views.py b/zilencer/views.py
index cd734051ce5..372eb9cbcf3 100644
--- a/zilencer/views.py
+++ b/zilencer/views.py
@@ -319,7 +319,11 @@ def remote_server_notify_push(
remote_queue_latency: Optional[str] = None
sent_time: Optional[Union[float, int]] = gcm_payload.get(
- "time", apns_payload["custom"]["zulip"].get("time")
+ # TODO/compatibility: This could be a lot simpler if not for pre-5.0 Zulip servers
+ # that had an older format. Future implementation:
+ # "time", apns_payload["custom"]["zulip"].get("time")
+ "time",
+ apns_payload.get("custom", {}).get("zulip", {}).get("time"),
)
if sent_time is not None:
if isinstance(sent_time, int):