Clean up do_narrow calls

(imported from commit 51a694e3dbe7310127580e50fbac0a796f1b09c2)
This commit is contained in:
Keegan McAllister 2012-09-24 13:55:30 -04:00
parent 32f806c032
commit 2a96542e9a
1 changed files with 3 additions and 9 deletions

View File

@ -490,18 +490,13 @@ function do_narrow(description, filter_function) {
function narrow_huddle() { function narrow_huddle() {
var original = zephyr_dict[selected_zephyr_id]; var original = zephyr_dict[selected_zephyr_id];
do_narrow("Group chats with " + original.reply_to, function (other) {
var message = "Group chats with " + original.reply_to;
do_narrow(message, function (other) {
return other.reply_to === original.reply_to; return other.reply_to === original.reply_to;
}); });
} }
function narrow_all_personals() { function narrow_all_personals() {
// Narrow to all personals do_narrow("All huddles with you", function (other) {
var message = "All huddles with you";
do_narrow(message, function (other) {
return other.type === "personal" || other.type === "huddle"; return other.type === "personal" || other.type === "huddle";
}); });
} }
@ -515,9 +510,8 @@ function narrow_personals() {
} else { } else {
other_party = original.display_recipient; 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') && return (other.type === 'personal') &&
(((other.display_recipient === original.display_recipient) && (other.sender_email === original.sender_email)) || (((other.display_recipient === original.display_recipient) && (other.sender_email === original.sender_email)) ||
((other.display_recipient === original.sender_email) && (other.sender_email === original.display_recipient))); ((other.display_recipient === original.sender_email) && (other.sender_email === original.display_recipient)));