refactor: Break subs dependency in stream_data.

We move remove_deactivated_user_from_all_streams
into stream_events.js.  There were some minor changes
to rename variables and also to not rely on using
`stream_info`.
This commit is contained in:
Steve Howell
2018-08-04 17:44:31 +00:00
committed by Tim Abbott
parent 25fa9a25ff
commit ecb3879d0c
6 changed files with 54 additions and 25 deletions

View File

@@ -381,16 +381,6 @@ exports.add_subscriber = function (stream_name, user_id) {
return true;
};
exports.remove_deactivated_user_from_all_streams = function (user_id) {
stream_info.values().forEach(function (stream) {
if (exports.is_user_subscribed(stream.name, user_id)) {
exports.remove_subscriber(stream.name, user_id);
var sub = exports.get_sub(stream.name);
subs.rerender_subscriptions_settings(sub);
}
});
};
exports.remove_subscriber = function (stream_name, user_id) {
var sub = exports.get_sub(stream_name);
if (typeof sub === 'undefined') {