mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
notifications: Include realm_uri in push notifications.
This should make it much simpler for the mobile apps to line up the data from server_settings against the data in the notifications. Addresses part of #10094.
This commit is contained in:
@@ -497,6 +497,7 @@ def get_common_payload(message: Message) -> Dict[str, Any]:
|
||||
# These will let the app support logging into multiple realms and servers.
|
||||
data['server'] = settings.EXTERNAL_HOST
|
||||
data['realm_id'] = message.sender.realm.id
|
||||
data['realm_uri'] = message.sender.realm.uri
|
||||
|
||||
# `sender_id` is preferred, but some existing versions use `sender_email`.
|
||||
data['sender_id'] = message.sender.id
|
||||
|
||||
@@ -744,6 +744,7 @@ class TestGetAPNsPayload(PushNotificationTest):
|
||||
'sender_id': 4,
|
||||
'server': settings.EXTERNAL_HOST,
|
||||
'realm_id': message.sender.realm.id,
|
||||
'realm_uri': message.sender.realm.uri,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -772,6 +773,7 @@ class TestGetAPNsPayload(PushNotificationTest):
|
||||
"topic": message.subject,
|
||||
'server': settings.EXTERNAL_HOST,
|
||||
'realm_id': message.sender.realm.id,
|
||||
'realm_uri': message.sender.realm.uri,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -803,6 +805,7 @@ class TestGetAPNsPayload(PushNotificationTest):
|
||||
'sender_id': 4,
|
||||
'server': settings.EXTERNAL_HOST,
|
||||
'realm_id': message.sender.realm.id,
|
||||
'realm_uri': message.sender.realm.uri,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -829,6 +832,7 @@ class TestGetGCMPayload(PushNotificationTest):
|
||||
"content_truncated": True,
|
||||
"server": settings.EXTERNAL_HOST,
|
||||
"realm_id": self.example_user("hamlet").realm.id,
|
||||
"realm_uri": self.example_user("hamlet").realm.uri,
|
||||
"sender_id": self.example_user("hamlet").id,
|
||||
"sender_email": self.example_email("hamlet"),
|
||||
"sender_full_name": "King Hamlet",
|
||||
@@ -854,6 +858,7 @@ class TestGetGCMPayload(PushNotificationTest):
|
||||
"content_truncated": False,
|
||||
"server": settings.EXTERNAL_HOST,
|
||||
"realm_id": self.example_user("hamlet").realm.id,
|
||||
"realm_uri": self.example_user("hamlet").realm.uri,
|
||||
"sender_id": self.example_user("hamlet").id,
|
||||
"sender_email": self.example_email("hamlet"),
|
||||
"sender_full_name": "King Hamlet",
|
||||
@@ -878,6 +883,7 @@ class TestGetGCMPayload(PushNotificationTest):
|
||||
"content_truncated": False,
|
||||
"server": settings.EXTERNAL_HOST,
|
||||
"realm_id": self.example_user("hamlet").realm.id,
|
||||
"realm_uri": self.example_user("hamlet").realm.uri,
|
||||
"sender_id": self.example_user("hamlet").id,
|
||||
"sender_email": self.example_email("hamlet"),
|
||||
"sender_full_name": "King Hamlet",
|
||||
@@ -905,6 +911,7 @@ class TestGetGCMPayload(PushNotificationTest):
|
||||
"content_truncated": False,
|
||||
"server": settings.EXTERNAL_HOST,
|
||||
"realm_id": self.example_user("hamlet").realm.id,
|
||||
"realm_uri": self.example_user("hamlet").realm.uri,
|
||||
"sender_id": self.example_user("hamlet").id,
|
||||
"sender_email": self.example_email("hamlet"),
|
||||
"sender_full_name": "King Hamlet",
|
||||
|
||||
Reference in New Issue
Block a user