mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
We do not show the warning while sending messages to announce stream if there is a wildcard mention in the message (i.e. when wildcard_mention != null) There are two cases where we should ideally show the warning but we don't- - When there is no wildcard mention in the message and wildcard_mention is set to undefined (initial value of wildcard_mention). This is because "wildcard_mention != null" returns true for this case and thus the warning is not shown, assuming the message to have wildcard mention. - When previous message had a wildcard mention and now a message is being sent with no wildcard mention. This is because the condition "wildcard_mention != null" is checked with the previous value of wildcard_mention and not with the value according to current message content, and thus the warning is not shown, assuming the message to have wildcard mention. This commit changes the code to set wildcard_mention from the latest message content before performing other validations and thus solves the problems described above.