Use stream_data.get_name() in narrow_state.stream().

Using get_name() is more robust for stream name changes.  This
fixes, for example, the situation where you narrow to a stream,
edit it via the sidebar, and then close the modal, and the message
redraw logic thinks you have unsubscribed.

Fixes #4686.
This commit is contained in:
Steve Howell 2017-05-11 16:09:11 -07:00 committed by Tim Abbott
parent 8b78f3f133
commit 252d0a6e15
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ exports.stream = function () {
}
var stream_operands = current_filter.operands("stream");
if (stream_operands.length === 1) {
return stream_operands[0];
var name = stream_operands[0];
// Use get_name() to get the most current stream
// name (considering renames and capitalization).
return stream_data.get_name(name);
}
return undefined;
};