snapshot_message: Get stream id from name instead of name from id.

This commit is contained in:
evykassirer 2023-06-26 10:12:00 -07:00 committed by Tim Abbott
parent d9edcba724
commit 8cee3dfbf2
1 changed files with 3 additions and 5 deletions

View File

@ -199,11 +199,9 @@ export function snapshot_message() {
message.reply_to = recipient;
message.private_message_recipient = recipient;
} else {
message.stream = compose_state.stream_name();
const sub = stream_data.get_sub(message.stream);
if (sub) {
message.stream_id = sub.stream_id;
}
message.stream_id = compose_state.stream_id();
const sub = stream_data.get_sub_by_id(message.stream_id);
message.stream = sub ? sub.name : "";
message.topic = compose_state.topic();
}
return message;