mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
Use stream_id in recipient comparisons.
Using stream_id in recipient comparisons fixes a bug in this scenario: go to home view, send message to stream, wait for admin to rename stream, send another message to the stream. Before this change, the stream name would live-update but you'd get a spurious recipient bar due to the prior message still having the old stream name in places internally. There were other ways to fix the live-update glitch, but it's just generally cleaner to do stream id comparisons. Part of this change is to add stream_id to compose_fade.set_focused_recipient().
This commit is contained in:
@@ -21,8 +21,13 @@ exports.set_focused_recipient = function (msg_type) {
|
||||
};
|
||||
|
||||
if (focused_recipient.type === "stream") {
|
||||
focused_recipient.stream = $('#stream').val();
|
||||
var stream_name = $('#stream').val();
|
||||
focused_recipient.subject = $('#subject').val();
|
||||
focused_recipient.stream = stream_name;
|
||||
var sub = stream_data.get_sub(stream_name);
|
||||
if (sub) {
|
||||
focused_recipient.stream_id = sub.stream_id;
|
||||
}
|
||||
} else {
|
||||
// Normalize the recipient list so it matches the one used when
|
||||
// adding the message (see message_store.add_message_metadata()).
|
||||
|
||||
Reference in New Issue
Block a user