From 6e0ea3d79a9a6e7a1c831ff0b5bdf0a81b07c9b3 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 9 May 2023 17:54:57 -0700 Subject: [PATCH] message_edit: Avoid confusing notice editing wildcard mention messages. It's highly confusing to suggest to a user that we'll send a second notification to all users when that's not the case. Fixes #25507. --- web/src/message_edit.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/web/src/message_edit.js b/web/src/message_edit.js index ba99af5ca1..bcfe9d8945 100644 --- a/web/src/message_edit.js +++ b/web/src/message_edit.js @@ -907,14 +907,17 @@ export function save_message_row_edit($row) { changed = old_content !== new_content; } - const wildcard_mention = util.find_wildcard_mentions(new_content); - const is_stream_message_mentions_valid = compose_validate.validate_stream_message_mentions( - stream_id, - $banner_container, - wildcard_mention, - ); - if (!is_stream_message_mentions_valid) { - return; + const already_has_wildcard_mention = message.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( + stream_id, + $banner_container, + wildcard_mention, + ); + if (!is_stream_message_mentions_valid) { + return; + } } show_message_edit_spinner($row);