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.

push_notifications: Fix APNs message generation.

Anders Kaseorg7ccefa524222
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py
index 6ccb6ca4d35..19ed8071d80 100644
--- a/zerver/lib/push_notifications.py
+++ b/zerver/lib/push_notifications.py
@@ -156,7 +156,8 @@ def send_apple_push_notification(
DeviceTokenClass = PushDeviceToken
logger.info("APNs: Sending notification for user %d to %d devices", user_id, len(devices))
- message = {"aps": modernize_apns_payload(payload_data)}
+ payload_data = modernize_apns_payload(payload_data).copy()
+ message = {**payload_data.pop("custom", {}), "aps": payload_data}
retries_left = APNS_MAX_RETRIES
for device in devices:
# TODO obviously this should be made to actually use the async