From beba14a86c8dc0897e4f4429f6a26fc28167e15c Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Fri, 3 May 2013 14:04:30 -0400 Subject: [PATCH] Only call add_message_metadata once when receiving messages in a narrowed view We memoize add_message_metadata by checking if the message is already in the all_msg_list. Therefore, we need to add messages to that message list before we add it to the narrowed_msg_list. (imported from commit 4346179376ef6f982162c02c6152a0d294bfb2c0) --- zephyr/static/js/zephyr.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index bf13938b13..f59562f79a 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -826,6 +826,9 @@ function get_updates(options) { // should no longer be needed messages = deduplicate_messages(messages); + add_messages(messages, all_msg_list); + add_messages(messages, home_msg_list); + if (narrow.active()) { if (narrow.filter().can_apply_locally()) { add_messages(messages, narrowed_msg_list); @@ -833,8 +836,7 @@ function get_updates(options) { maybe_add_narrowed_messages(messages, narrowed_msg_list); } } - add_messages(messages, all_msg_list); - add_messages(messages, home_msg_list); + process_visible_unread_messages(); notifications.received_messages(messages); compose.update_faded_messages();