From 2a96542e9ac10fd29ca5bfd7c30875521ee27dcd Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 24 Sep 2012 13:55:30 -0400 Subject: [PATCH] Clean up do_narrow calls (imported from commit 51a694e3dbe7310127580e50fbac0a796f1b09c2) --- zephyr/static/js/zephyr.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index c39bb20fb7..1a4164b653 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -490,18 +490,13 @@ function do_narrow(description, filter_function) { function narrow_huddle() { var original = zephyr_dict[selected_zephyr_id]; - - var message = "Group chats with " + original.reply_to; - - do_narrow(message, function (other) { + do_narrow("Group chats with " + original.reply_to, function (other) { return other.reply_to === original.reply_to; }); } function narrow_all_personals() { - // Narrow to all personals - var message = "All huddles with you"; - do_narrow(message, function (other) { + do_narrow("All huddles with you", function (other) { return other.type === "personal" || other.type === "huddle"; }); } @@ -515,9 +510,8 @@ function narrow_personals() { } else { other_party = original.display_recipient; } - var message = "Huddles with " + other_party; - do_narrow(message, function (other) { + do_narrow("Huddles with " + other_party, function (other) { return (other.type === 'personal') && (((other.display_recipient === original.display_recipient) && (other.sender_email === original.sender_email)) || ((other.display_recipient === original.sender_email) && (other.sender_email === original.display_recipient)));