Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
push_notification: Remove 'content_truncated' field from FCM payload.
Prakhar Pratyushdd134ef32504
diff --git a/api_docs/changelog.md b/api_docs/changelog.mdindex 0c9c7caf914..ed78b5c0c10 100644--- a/api_docs/changelog.md+++ b/api_docs/changelog.md@@ -28,6 +28,8 @@ format used by the Zulip server that they are interacting with.notifications no longer contain the legacy pre-2019`zulip_message_id` field; all functional clients support the newer`zulip_message_ids`.+* Mobile push notification payloads for FCM to for new messages no+ longer contain the (unused) `content_truncated` boolean field.**Feature level 412**diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.pyindex dea1474c168..a9284cc8935 100644--- a/zerver/lib/push_notifications.py+++ b/zerver/lib/push_notifications.py@@ -1180,13 +1180,12 @@ def get_message_payload_gcm(assert message.rendered_content is not Nonewith override_language(user_profile.default_language):- content, truncated = truncate_content(get_mobile_push_content(message.rendered_content))+ content, unused = truncate_content(get_mobile_push_content(message.rendered_content))data.update(event="message",zulip_message_id=message.id, # message_id is reserved for CCStime=datetime_to_timestamp(message.date_sent),content=content,- content_truncated=truncated,sender_full_name=sender_name,sender_avatar_url=sender_avatar_url,)diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.pyindex 8c24da09750..ba6f3c4d60c 100644--- a/zerver/tests/test_push_notifications.py+++ b/zerver/tests/test_push_notifications.py@@ -784,7 +784,6 @@ class PushBouncerNotificationTest(BouncerTestCase):"zulip_message_id": message.id,"time": datetime_to_timestamp(message.date_sent),"content": message.content,- "content_truncated": False,"server": settings.EXTERNAL_HOST,"realm_id": hamlet.realm.id,"realm_uri": hamlet.realm.url,@@ -1816,7 +1815,6 @@ class TestGetGCMPayload(PushNotificationTestCase):"zulip_message_id": message.id,"time": datetime_to_timestamp(message.date_sent),"content": content,- "content_truncated": truncate_content,"server": settings.EXTERNAL_HOST,"realm_id": hamlet.realm.id,"realm_name": hamlet.realm.name,@@ -1879,7 +1877,6 @@ class TestGetGCMPayload(PushNotificationTestCase):"zulip_message_id": message.id,"time": datetime_to_timestamp(message.date_sent),"content": message.content,- "content_truncated": False,"server": settings.EXTERNAL_HOST,"realm_id": hamlet.realm.id,"realm_name": hamlet.realm.name,@@ -1927,7 +1924,6 @@ class TestGetGCMPayload(PushNotificationTestCase):"zulip_message_id": message.id,"time": datetime_to_timestamp(message.date_sent),"content": message.content,- "content_truncated": False,"server": settings.EXTERNAL_HOST,"realm_id": hamlet.realm.id,"realm_name": hamlet.realm.name,