Fix PM unread counts not displaying

This was broken in two ways:

1. Commit ad59d6f78042ce89, "Make the left sidebar and right sidebar
more consistent", pushed last Monday, changed the markup for the right
sidebar without changing a selector in stream_list.js that was looking
for the old markup.

2. Even then, whenever new user presence information came in, we would
rerender the user list and blow away the unread counts. This commit
patches around that by updating unread counts after rendering the user
list. I'm not sure what broke this or how it was working before.

(imported from commit 53ed40139e257e44411e918d1ecdce3a49e9ee51)
This commit is contained in:
Scott Feeney 2013-08-21 14:52:27 -04:00 committed by Steve Howell
parent 400dfcb879
commit 6de6ced290
3 changed files with 6 additions and 1 deletions

View File

@ -64,7 +64,7 @@ function get_filter_li(type, name) {
if (type === 'stream') {
return $("#stream_sidebar_" + subs.stream_id(name));
} else if (type === "private") {
return $(".user_sidebar_entry > a[data-email='" + name + "']");
return $("li.user_sidebar_entry[data-email='" + name + "']");
}
return iterate_to_find("#" + type + "_filters > li", name);
}

View File

@ -1483,6 +1483,10 @@ exports.set_presence_list = function (users, presence_info) {
var user_info = [my_info].concat(_.map(user_emails, info_for));
$('#user_presences').html(templates.render('user_presence_rows', {users: user_info}));
// FIXME: This should probably be rendered in the template directly, but
// currently we have to update unread counts after rendering the template
// or they get blown away.
update_unread_counts();
};
// Save the compose content cursor position and restore when we

View File

@ -56,6 +56,7 @@ var globals =
+ ' mark_message_as_read'
+ ' send_summarize_in_home'
+ ' send_summarize_in_stream'
+ ' update_unread_counts'
;