default stream: Limit private streams in default stream suggestions.

Admin users can't add private unsubscribed streams to the default
streams list.  Therefore, we shouldn't include private streams the
user is not subscribed to in the default stream suggestions.
This commit is contained in:
Yashashvi Dave
2018-08-07 19:30:56 +05:30
committed by Tim Abbott
parent 6e136be975
commit ee8948c3e1

View File

@@ -141,7 +141,7 @@ exports.delete_sub = function (stream_id) {
exports.get_non_default_stream_names = function () {
var subs = stream_info.values();
subs = _.reject(subs, function (sub) {
return exports.is_default_stream_id(sub.stream_id);
return exports.is_default_stream_id(sub.stream_id) || !sub.subscribed && sub.invite_only;
});
var names = _.pluck(subs, 'name');
return names;