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.

message send: Calculate `wildcard_mention_notify` pre-send_event.

Abhijeet Prasad Bodas40cd6b544026
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index ca12111517d..feb837cdbdf 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -1975,7 +1975,9 @@ def do_send_messages(
users: List[Dict[str, Union[int, List[str], bool]]] = []
for user_id in user_list:
flags = user_flags.get(user_id, [])
- wildcard_mention_notify = user_id in send_request.wildcard_mention_user_ids
+ wildcard_mention_notify = (
+ user_id in send_request.wildcard_mention_user_ids and "wildcard_mentioned" in flags
+ )
users.append(
dict(
id=user_id,
diff --git a/zerver/tornado/event_queue.py b/zerver/tornado/event_queue.py
index 521c38b86a1..89de868c574 100644
--- a/zerver/tornado/event_queue.py
+++ b/zerver/tornado/event_queue.py
@@ -749,9 +749,7 @@ def missedmessage_hook(
# stream_push_notify is set in process_message_event.
stream_push_notify = internal_data.get("stream_push_notify", False)
stream_email_notify = internal_data.get("stream_email_notify", False)
- wildcard_mention_notify = (
- internal_data.get("wildcard_mention_notify", False) and "wildcard_mentioned" in flags
- )
+ wildcard_mention_notify = internal_data.get("wildcard_mention_notify", False)
stream_name = None
if not private_message:
@@ -954,9 +952,7 @@ def process_message_event(
mentioned = "mentioned" in flags
stream_push_notify = user_data.get("stream_push_notify", False)
stream_email_notify = user_data.get("stream_email_notify", False)
- wildcard_mention_notify = (
- user_data.get("wildcard_mention_notify", False) and "wildcard_mentioned" in flags
- )
+ wildcard_mention_notify = user_data.get("wildcard_mention_notify", False)
sender_is_muted = user_data.get("sender_is_muted", False)
extra_user_data[user_profile_id] = dict(