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_notification: Remove "time" field from APNs payload.

Prakhar Pratyush6c625a0177f4
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py
index 12991ec6e8a..b3658956149 100644
--- a/zerver/lib/push_notifications.py
+++ b/zerver/lib/push_notifications.py
@@ -1000,7 +1000,6 @@ def get_message_payload(
else:
data["sender_email"] = message.sender.email
- data["time"] = datetime_to_timestamp(message.date_sent)
if mentioned_user_group_id is not None:
assert mentioned_user_group_name is not None
data["mentioned_user_group_id"] = mentioned_user_group_id
@@ -1176,6 +1175,7 @@ def get_message_payload_gcm(
data.update(
event="message",
zulip_message_id=message.id, # message_id is reserved for CCS
+ time=datetime_to_timestamp(message.date_sent),
content=content,
content_truncated=truncated,
sender_full_name=sender_name,
diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py
index bef6dab6c4e..4fef55eecb1 100644
--- a/zerver/tests/test_push_notifications.py
+++ b/zerver/tests/test_push_notifications.py
@@ -1474,7 +1474,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
- "time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1517,7 +1516,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
- "time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1562,7 +1560,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
- "time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1604,7 +1601,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": self.sender.id,
- "time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1649,7 +1645,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
- "time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1690,7 +1685,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"user_id": user_profile.id,
"mentioned_user_group_id": user_group.id,
"mentioned_user_group_name": user_group.name,
- "time": datetime_to_timestamp(message.date_sent),
}
},
}
@@ -1728,7 +1722,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
- "time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1799,7 +1792,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": hamlet.realm.url,
"realm_url": hamlet.realm.url,
"user_id": polonius.id,
- "time": datetime_to_timestamp(message.date_sent),
}
},
}