Use fold_case:true for subscribers Dict

(imported from commit 8acc794cb5369baadef512a9fcdb3537231dd604)
This commit is contained in:
Steve Howell 2013-09-16 17:40:57 -04:00
parent 031f5f5333
commit e1b881629c
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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'));