topic_mentions: Rename wildcard_mentioned to stream_wildcard_mentioned.

Rename the existing 'wildcard_mentioned' flag to
'stream_wildcard_mentioned'.

The 'wildcard_mentioned' flag is deprecated and exists for
backwards compatibility.

We have two separate flags for stream and topic wildcard mentions,
i.e., 'stream_wildcard_mentioned' and 'topic_wildcard_mentioned',
respectively.

* stream wildcard mentions: `@all`, `@everyone`, and `@stream`
* topic wildcard mentions: `@topic`

The `wildcard_mentioned` flag is included in the events and
API response if either `stream_wildcard_mentioned` or
`topic_wildcard_mentioned` is set.
This commit is contained in:
Prakhar Pratyush
2023-11-03 19:50:44 +05:30
committed by Tim Abbott
parent 24fa361f40
commit c597de6a1d
22 changed files with 227 additions and 80 deletions

View File

@@ -958,7 +958,8 @@ export function save_message_row_edit($row) {
changed = old_content !== new_content;
}
const already_has_wildcard_mention = message.wildcard_mentioned;
const already_has_wildcard_mention =
message.stream_wildcard_mentioned || message.topic_wildcard_mentioned;
if (!already_has_wildcard_mention) {
const wildcard_mention = util.find_wildcard_mentions(new_content);
const is_stream_message_mentions_valid = compose_validate.validate_stream_message_mentions({