mirror of https://github.com/zulip/zulip.git
notifications: Shorten string for redacted content.
Replace the long string for organisations that have notification body/content disabled (settings.PUSH_NOTIFICATION_REDACT_CONTENT set to true) with "New message". Fixes #29152
This commit is contained in:
parent
a5cf0ec526
commit
d9c5eb1280
|
@ -922,13 +922,7 @@ def get_mobile_push_content(rendered_content: str) -> str:
|
||||||
return plain_text
|
return plain_text
|
||||||
|
|
||||||
if settings.PUSH_NOTIFICATION_REDACT_CONTENT:
|
if settings.PUSH_NOTIFICATION_REDACT_CONTENT:
|
||||||
return (
|
return _("New message")
|
||||||
"*"
|
|
||||||
+ _(
|
|
||||||
"This organization has disabled including message content in mobile push notifications"
|
|
||||||
)
|
|
||||||
+ "*"
|
|
||||||
)
|
|
||||||
|
|
||||||
elem = lxml.html.fragment_fromstring(rendered_content, create_parent=True)
|
elem = lxml.html.fragment_fromstring(rendered_content, create_parent=True)
|
||||||
change_katex_to_raw_latex(elem)
|
change_katex_to_raw_latex(elem)
|
||||||
|
|
|
@ -4109,7 +4109,7 @@ class TestGetAPNsPayload(PushNotificationTest):
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "Cordelia, Lear's daughter, King Hamlet, Othello, the Moor of Venice",
|
"title": "Cordelia, Lear's daughter, King Hamlet, Othello, the Moor of Venice",
|
||||||
"subtitle": "King Hamlet:",
|
"subtitle": "King Hamlet:",
|
||||||
"body": "*This organization has disabled including message content in mobile push notifications*",
|
"body": "New message",
|
||||||
},
|
},
|
||||||
"sound": "default",
|
"sound": "default",
|
||||||
"badge": 0,
|
"badge": 0,
|
||||||
|
@ -4305,7 +4305,7 @@ class TestGetGCMPayload(PushNotificationTest):
|
||||||
"event": "message",
|
"event": "message",
|
||||||
"zulip_message_id": message.id,
|
"zulip_message_id": message.id,
|
||||||
"time": datetime_to_timestamp(message.date_sent),
|
"time": datetime_to_timestamp(message.date_sent),
|
||||||
"content": "*This organization has disabled including message content in mobile push notifications*",
|
"content": "New message",
|
||||||
"content_truncated": False,
|
"content_truncated": False,
|
||||||
"server": settings.EXTERNAL_HOST,
|
"server": settings.EXTERNAL_HOST,
|
||||||
"realm_id": hamlet.realm.id,
|
"realm_id": hamlet.realm.id,
|
||||||
|
|
Loading…
Reference in New Issue