Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_edit: Check resolve topic notifications earlier.

Julia Bichler83254a3d7933
diff --git a/zerver/actions/message_edit.py b/zerver/actions/message_edit.py
index 026b030ac67..9ac5fcac4ab 100644
--- a/zerver/actions/message_edit.py
+++ b/zerver/actions/message_edit.py
@@ -820,6 +820,21 @@ def do_update_message(
send_event(user_profile.realm, event, users_to_be_notified)
+ if (
+ topic_name is not None
+ and new_stream is None
+ and content is None
+ and len(changed_messages) > 0
+ ):
+ assert stream_being_edited is not None
+ maybe_send_resolve_topic_notifications(
+ user_profile=user_profile,
+ stream=stream_being_edited,
+ old_topic=orig_topic_name,
+ new_topic=topic_name,
+ changed_messages=changed_messages,
+ )
+
if len(changed_messages) > 0 and new_stream is not None and stream_being_edited is not None:
# Notify users that the topic was moved.
changed_messages_count = len(changed_messages)
@@ -865,21 +880,6 @@ def do_update_message(
changed_messages_count,
)
- if (
- topic_name is not None
- and new_stream is None
- and content is None
- and len(changed_messages) > 0
- ):
- assert stream_being_edited is not None
- maybe_send_resolve_topic_notifications(
- user_profile=user_profile,
- stream=stream_being_edited,
- old_topic=orig_topic_name,
- new_topic=topic_name,
- changed_messages=changed_messages,
- )
-
return len(changed_messages)