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.

compose_validate: Don't show moved warning if current user moved topic.

Vector73a75db9250bf6
diff --git a/web/src/compose_validate.ts b/web/src/compose_validate.ts
index 5fe074b1c83..44c5ae0031e 100644
--- a/web/src/compose_validate.ts
+++ b/web/src/compose_validate.ts
@@ -29,7 +29,7 @@ import * as people from "./people.ts";
import * as reactions from "./reactions.ts";
import * as recent_senders from "./recent_senders.ts";
import * as settings_data from "./settings_data.ts";
-import {realm} from "./state_data.ts";
+import {current_user, realm} from "./state_data.ts";
import * as stream_data from "./stream_data.ts";
import * as sub_store from "./sub_store.ts";
import type {StreamSubscription} from "./sub_store.ts";
@@ -513,9 +513,13 @@ export function clear_topic_moved_info(): void {
$(`#compose_banners .${CSS.escape(compose_banner.CLASSNAMES.topic_is_moved)}`).remove();
}
-export function inform_if_topic_is_moved(orig_topic: string, old_stream_id: number): void {
+export function inform_if_topic_is_moved(
+ orig_topic: string,
+ old_stream_id: number,
+ acting_user_id: number | null,
+): void {
const stream_id = compose_state.stream_id();
- if (stream_id === undefined) {
+ if (stream_id === undefined || acting_user_id === current_user.user_id) {
clear_topic_moved_info();
return;
}
diff --git a/web/src/message_events.ts b/web/src/message_events.ts
index 9229ccc4b05..f6f0df53991 100644
--- a/web/src/message_events.ts
+++ b/web/src/message_events.ts
@@ -551,7 +551,7 @@ export function update_messages(events: UpdateMessageEvent[]): void {
}
compose_validate.warn_if_topic_resolved(true);
- compose_validate.inform_if_topic_is_moved(orig_topic, old_stream_id);
+ compose_validate.inform_if_topic_is_moved(orig_topic, old_stream_id, event.user_id);
compose_fade.set_focused_recipient("stream");
}