notifications: Fix 'get_gcm_alert' and 'get_apns_alert_subtitle'.

The 'get_gcm_alert' and 'get_apns_alert_subtitle' functions
don't include the case when the trigger is
'NotificationTriggers.FOLLOWED_TOPIC_WILDCARD_MENTION'.

This commit updates the functions to include
'NotificationTriggers.FOLLOWED_TOPIC_WILDCARD_MENTION'.
This commit is contained in:
Prakhar Pratyush
2023-06-22 18:18:24 +05:30
committed by Tim Abbott
parent 5f6dd83696
commit 0bf6eb6786
2 changed files with 43 additions and 0 deletions

View File

@@ -672,6 +672,11 @@ def get_gcm_alert(
return f"{sender_str} mentioned you in #{display_recipient}"
else:
return f"{sender_str} mentioned @{mentioned_user_group_name} in #{display_recipient}"
elif (
message.is_stream_message()
and trigger == NotificationTriggers.FOLLOWED_TOPIC_WILDCARD_MENTION
):
return "TODO"
elif message.is_stream_message() and trigger == NotificationTriggers.WILDCARD_MENTION:
return f"{sender_str} mentioned everyone in #{display_recipient}"
else:
@@ -837,6 +842,8 @@ def get_apns_alert_subtitle(
)
else:
return _("{full_name} mentioned you:").format(full_name=message.sender.full_name)
elif trigger == NotificationTriggers.FOLLOWED_TOPIC_WILDCARD_MENTION:
return _("TODO")
elif trigger == NotificationTriggers.WILDCARD_MENTION:
return _("{full_name} mentioned everyone:").format(full_name=message.sender.full_name)
elif message.recipient.type == Recipient.PERSONAL: