mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 23:19:10 +00:00
Import initial subscriber lists from page_params.stream_list
(imported from commit b9679d30e4235efb6f47c2fa6c006790df616564)
This commit is contained in:
@@ -92,6 +92,33 @@ exports.get_name = function (stream_name) {
|
||||
return sub.name;
|
||||
};
|
||||
|
||||
exports.add_subscriber = function (stream_name, user_email) {
|
||||
var sub = exports.get_sub(stream_name);
|
||||
if (!sub.hasOwnProperty('subscribers')) {
|
||||
// FIXME: Temporary hack because this is not initialized.
|
||||
sub.subscribers = new Dict();
|
||||
}
|
||||
sub.subscribers.set(user_email, true);
|
||||
};
|
||||
|
||||
exports.remove_subscriber = function (stream_name, user_email) {
|
||||
var sub = exports.get_sub(stream_name);
|
||||
if (!sub.hasOwnProperty('subscribers')) {
|
||||
// FIXME: Temporary hack because this is not initialized.
|
||||
return;
|
||||
}
|
||||
sub.subscribers.del(user_email);
|
||||
};
|
||||
|
||||
exports.user_is_subscribed = function (stream_name, user_email) {
|
||||
var sub = exports.get_sub(stream_name);
|
||||
if (!sub.hasOwnProperty('subscribers')) {
|
||||
// FIXME: Hack because this is not fully implemented.
|
||||
return undefined;
|
||||
}
|
||||
return sub.subscribers.has(user_email);
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
||||
}());
|
||||
|
||||
@@ -334,7 +334,8 @@ function populate_subscriptions(subs, subscribed) {
|
||||
var sub = create_sub(stream_name, {color: elem.color, in_home_view: elem.in_home_view,
|
||||
invite_only: elem.invite_only,
|
||||
notifications: elem.notifications, subscribed: subscribed,
|
||||
email_address: elem.email_address});
|
||||
email_address: elem.email_address,
|
||||
subscribers: Dict.from_array(elem.subscribers)});
|
||||
sub_rows.push(sub);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user