mirror of https://github.com/zulip/zulip.git
message send: Calculate `wildcard_mention_notify` pre-send_event.
This deduplicates some logic, and makes it so that `wildcard_mention_notify` always contains what its name says it does.
This commit is contained in:
parent
919f0a5964
commit
40cd6b5440
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue