mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
user_pill: Add Zephyr logic.
For Zephyr realms we have to be more lax with email validation. This will be relevant for compose pills.
This commit is contained in:
@@ -10,6 +10,23 @@ exports.create_item_from_email = function (email, current_items) {
|
||||
var user = people.get_by_email(email);
|
||||
|
||||
if (!user) {
|
||||
if (page_params.realm_is_zephyr_mirror_realm) {
|
||||
var existing_emails = _.pluck(current_items, 'email');
|
||||
|
||||
if (existing_emails.indexOf(email) >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// For Zephyr we can't assume any emails are invalid,
|
||||
// so we just create a pill where the display value
|
||||
// is the email itself.
|
||||
return {
|
||||
display_value: email,
|
||||
email: email,
|
||||
};
|
||||
}
|
||||
|
||||
// The email is not allowed, so return.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user