Exclude humbuggers from the new stream modal

For people who aren't on the @humbughq.com realm the tutorial bot showed
up in the create new stream modal but attempting to invite them failed.

This was most often noticed with the tutorial bot.

In the future we should figure out a really good cross-realm story, but
in the near-term we need to probably exclude other people outside your
realm rather than special-casing @humbughq.com.

This closes trac #1059.

(imported from commit df704df0c8ae84b23d9491ce6ab77300831cdd20)
This commit is contained in:
Luke Faraone 2013-03-07 15:26:28 -05:00
parent a7495a8470
commit 93b4fcfeac
1 changed files with 9 additions and 4 deletions

View File

@ -579,15 +579,20 @@ function people_cmp(person1, person2) {
}
function show_new_stream_modal() {
var people_minus_you = [];
var people_minus_you_and_maybe_humbuggers = [];
$.each(people_list, function (idx, person) {
if (person.email !== email) {
people_minus_you.push({"email": person.email, "full_name": person.full_name});
if (person.email !== email &&
(domain === "humbughq.com" ||
person.email.split('@')[1] !== "humbughq.com"
)
) {
people_minus_you_and_maybe_humbuggers.push({"email": person.email,
"full_name": person.full_name});
}
});
$('#people_to_add').html(templates.new_stream_users({
users: people_minus_you.sort(people_cmp)
users: people_minus_you_and_maybe_humbuggers.sort(people_cmp)
}));
$('#stream-creation').modal("show");
}