message_list_view: Use stream_id to get sub object for populating group.

This commit changes populate_group_for_message_container function to
use stream id to get sub object, instead of stream name.
We already have stream id from message object, so we can easily
use it to fetch sub. We are using stream ids so that we can
avoid bugs related to live update after stream rename.
This commit is contained in:
sahil839 2020-06-21 01:36:49 +05:30 committed by Tim Abbott
parent 235601d3b6
commit b7f6a51797
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ function populate_group_from_message_container(group, message_container) {
group.match_topic = util.get_match_topic(message_container.msg);
group.stream_url = message_container.stream_url;
group.topic_url = message_container.topic_url;
const sub = stream_data.get_sub(message_container.msg.stream);
const sub = stream_data.get_sub_by_id(message_container.msg.stream_id);
if (sub === undefined) {
// Hack to handle unusual cases like the tutorial where
// the streams used don't actually exist in the subs