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:
Steve Howell
2017-02-22 18:53:02 -08:00
committed by Tim Abbott
parent c02cf5dd5c
commit 4d0d18ba14
4 changed files with 14 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ exports.lower_bound = function (array, arg1, arg2, arg3, arg4) {
exports.same_stream_and_topic = function util_same_stream_and_topic(a, b) {
// Streams and topics are case-insensitive.
return ((a.stream.toLowerCase() === b.stream.toLowerCase()) &&
return ((a.stream_id === b.stream_id) &&
(a.subject.toLowerCase() === b.subject.toLowerCase()));
};