From 93b4fcfeac5cd31ae081398c5063f9526be5c8bc Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Thu, 7 Mar 2013 15:26:28 -0500 Subject: [PATCH] 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) --- zephyr/static/js/subs.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index a1d3034395..e0120dce09 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -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"); }