Have get_stream_li() take a stream_id.

Rather than having get_stream_li() look up stream id using
stream name, we force the callers to pass in the stream id.

This adds an extra line to most of the callers for now, but
this will eventually change as we fix some of the callers to
have their callers pass in stream_id.

In places where we now call stream_data.get_stream_id() to
get the stream id, we will be more resilient toward stream
renamings, at least until the next reload, since
stream_data.get_stream_id() can resolve old names that
are stored when we process stream-rename events.
This commit is contained in:
Steve Howell
2017-05-13 08:41:10 -07:00
committed by Tim Abbott
parent a48419310e
commit d3a7aa3a37
4 changed files with 21 additions and 17 deletions

View File

@@ -48,7 +48,7 @@ exports.update_in_home_view = function (sub, value) {
}
}, 0);
stream_list.set_in_home_view(sub.name, sub.in_home_view);
stream_list.set_in_home_view(sub.stream_id, sub.in_home_view);
var not_in_home_view_checkbox = $(".subscription_settings[data-stream-id='" + sub.stream_id + "'] #sub_setting_not_in_home_view .sub_setting_control");
not_in_home_view_checkbox.prop('checked', !value);