mirror of https://github.com/zulip/zulip.git
Use fold_case:true for subscribers Dict
(imported from commit 8acc794cb5369baadef512a9fcdb3537231dd604)
This commit is contained in:
parent
031f5f5333
commit
e1b881629c
|
@ -93,7 +93,7 @@ exports.get_name = function (stream_name) {
|
|||
};
|
||||
|
||||
exports.set_subscribers = function (sub, emails) {
|
||||
sub.subscribers = Dict.from_array(emails || []);
|
||||
sub.subscribers = Dict.from_array(emails || [], {fold_case: true});
|
||||
};
|
||||
|
||||
// NOTE: If you do anything with the `subscribers` attribute on the stream
|
||||
|
|
|
@ -74,6 +74,7 @@ var stream_data = require('js/stream_data.js');
|
|||
stream_data.add_sub('Rome', sub);
|
||||
|
||||
stream_data.set_subscribers(sub, ['fred@zulip.com', 'george@zulip.com']);
|
||||
assert(stream_data.user_is_subscribed('Rome', 'FRED@zulip.com'));
|
||||
assert(stream_data.user_is_subscribed('Rome', 'fred@zulip.com'));
|
||||
assert(stream_data.user_is_subscribed('Rome', 'george@zulip.com'));
|
||||
assert(!stream_data.user_is_subscribed('Rome', 'not_fred@zulip.com'));
|
||||
|
|
Loading…
Reference in New Issue