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)
This commit is contained in:
Zev Benjamin 2013-05-03 14:04:30 -04:00 committed by Tim Abbott
parent 96129b1cf0
commit beba14a86c
1 changed files with 4 additions and 2 deletions

View File

@ -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();