mention: Replace 'wildcards' with 'stream_wildcards'.

This prep commit replaces the 'wildcard' keyword in the codebase
with 'stream_wildcard' at some places for better readability, as
we plan to introduce 'topic_wildcards' as a part of the
'@topic mention' project.

Currently, 'wildcards = ["all", "everyone", "stream"]' which is an
alias to mention everyone in the stream, hence better renamed as
'stream_wildcards'.

Eventually, we will have:
'stream_wildcard' as an alias to mention everyone in the stream.
'topic_wildcard' as an alias to mention everyone in the topic.
'wildcard' refers to 'stream_wildcard' and 'topic_wildcard' as a whole.
This commit is contained in:
Prakhar Pratyush
2023-06-03 20:21:38 +05:30
committed by Tim Abbott
parent d80779435a
commit 179d5cb37d
28 changed files with 444 additions and 320 deletions

View File

@@ -456,13 +456,14 @@ def do_send_missedmessage_events_reply_in_zulip(
context.update(
mention="mentioned" in unique_triggers
or "wildcard_mentioned" in unique_triggers
or "followed_topic_wildcard_mentioned" in unique_triggers,
or "stream_wildcard_mentioned" in unique_triggers
or "stream_wildcard_mentioned_in_followed_topic" in unique_triggers,
personal_mentioned=personal_mentioned,
wildcard_mentioned="wildcard_mentioned" in unique_triggers,
stream_wildcard_mentioned="stream_wildcard_mentioned" in unique_triggers,
stream_email_notify="stream_email_notify" in unique_triggers,
followed_topic_email_notify="followed_topic_email_notify" in unique_triggers,
followed_topic_wildcard_mentioned="followed_topic_wildcard_mentioned" in unique_triggers,
stream_wildcard_mentioned_in_followed_topic="stream_wildcard_mentioned_in_followed_topic"
in unique_triggers,
mentioned_user_group_name=mentioned_user_group_name,
)
@@ -525,8 +526,9 @@ def do_send_missedmessage_events_reply_in_zulip(
m["message"].sender
for m in missed_messages
if m["trigger"] == NotificationTriggers.MENTION
or m["trigger"] == NotificationTriggers.WILDCARD_MENTION
or m["trigger"] == NotificationTriggers.FOLLOWED_TOPIC_WILDCARD_MENTION
or m["trigger"] == NotificationTriggers.STREAM_WILDCARD_MENTION
or m["trigger"]
== NotificationTriggers.STREAM_WILDCARD_MENTION_IN_FOLLOWED_TOPIC
}
)
message = missed_messages[0]["message"]