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: Replace 'REDACTED' string.

Tim Abbott0be35f530b82
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py
index de05c225e01..499514e8763 100644
--- a/zerver/lib/push_notifications.py
+++ b/zerver/lib/push_notifications.py
@@ -630,7 +630,13 @@ def get_mobile_push_content(rendered_content: str) -> str:
return plain_text
if settings.PUSH_NOTIFICATION_REDACT_CONTENT:
- return "***" + _("REDACTED") + "***"
+ return (
+ "*"
+ + _(
+ "This organization has disabled including message content in mobile push notifications"
+ )
+ + "*"
+ )
elem = lxml.html.fromstring(rendered_content)
plain_text = process(elem)
diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py
index 782f199d7c1..8ef40c5cceb 100644
--- a/zerver/tests/test_push_notifications.py
+++ b/zerver/tests/test_push_notifications.py
@@ -1661,7 +1661,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"alert": {
"title": "Cordelia, Lear's daughter, King Hamlet, Othello, the Moor of Venice",
"subtitle": "King Hamlet:",
- "body": "***REDACTED***",
+ "body": "*This organization has disabled including message content in mobile push notifications*",
},
"sound": "default",
"badge": 0,
@@ -1807,7 +1807,7 @@ class TestGetGCMPayload(PushNotificationTest):
"alert": "New stream message from King Hamlet in Denmark",
"zulip_message_id": message.id,
"time": datetime_to_timestamp(message.date_sent),
- "content": "***REDACTED***",
+ "content": "*This organization has disabled including message content in mobile push notifications*",
"content_truncated": False,
"server": settings.EXTERNAL_HOST,
"realm_id": hamlet.realm.id,