compose: Echo messages sent to "(no topic)"/"general chat" to topic="".

Server treats messages sent to "(no topic) or "general chat"
topic as being sent to empty string topic.

Messages sent in web client to "(no topic)" and "general chat"
were locally echoed to those respective topics, resulting in
being narrowed to those topics.

Ideally, the messages should be echoed in the empty string topic.

This commit fixes that bug.
This commit is contained in:
Prakhar Pratyush
2025-03-19 08:03:02 +05:30
committed by Tim Abbott
parent 9a46104684
commit 80b772795c

View File

@@ -108,7 +108,8 @@ export function create_message_object(message_content = compose_state.message_co
message.to = people.user_ids_string_to_ids_array(message.to_user_ids);
}
} else {
message.topic = compose_state.topic();
const topic = compose_state.topic();
message.topic = util.is_topic_name_considered_empty(topic) ? "" : topic;
const stream_id = compose_state.stream_id();
message.stream_id = stream_id;
message.to = stream_id;