zilencer: Handle very old server push notifications.

Tweaked by tabbott to add a comment about deprecation policies.
This commit is contained in:
Alex Vandiver 2023-10-04 19:55:58 +00:00 committed by Tim Abbott
parent f99cce91bf
commit ba97611a8b
1 changed files with 5 additions and 1 deletions

View File

@ -319,7 +319,11 @@ def remote_server_notify_push(
remote_queue_latency: Optional[str] = None remote_queue_latency: Optional[str] = None
sent_time: Optional[Union[float, int]] = gcm_payload.get( 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 sent_time is not None:
if isinstance(sent_time, int): if isinstance(sent_time, int):