mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
Display a total count of the number of PMs you have pending.
This is accomplished by continuning to have per-conversation PM counts but then summing them up into a global count. We may split this off into per-conversation counts in the future. (imported from commit 311e3b74715c3a01c0b75837e397a386ab65505c)
This commit is contained in:
parent
148e47e74a
commit
32a406a5cf
@ -116,8 +116,8 @@ var people_list = [
|
||||
<ul class="filters">
|
||||
<div id="global_filters">
|
||||
{# Special-case this link so we don't actually go to page top. #}
|
||||
<li id="filthome" class="active-filter"><a href="#" onclick="ui.change_tab_to('#home');narrow.deactivate();return false" >Home</a></li>
|
||||
<li id="filtpers"><a href="#narrow/is/private-message">All private messages</a></li>
|
||||
<li data-name="home" class="active-filter"><a href="#" onclick="ui.change_tab_to('#home');narrow.deactivate();return false" >Home <span class="count">(<span class="value"></span>)</span></a></li>
|
||||
<li data-name="private" ><a href="#narrow/is/private-message">All private messages <span class="count">(<span class="value"></span>)</span></a></li>
|
||||
</div>
|
||||
<hr id="stream_filters_sep">
|
||||
<div id="stream_filters" class="scrolling_list"></div>
|
||||
|
||||
@ -183,7 +183,7 @@ function message_range(start, end) {
|
||||
var unread_filters = {'stream': {}, 'private': {}};
|
||||
|
||||
function process_unread_counts(messages, decrement) {
|
||||
var existing, hashkey;
|
||||
var existing, hashkey, pm_count;
|
||||
$.each(messages, function (index, message) {
|
||||
if (message.id <= furthest_read && decrement !== true) {
|
||||
return;
|
||||
@ -210,6 +210,12 @@ function process_unread_counts(messages, decrement) {
|
||||
$.each(unread_filters.stream, function(index, obj) {
|
||||
ui.set_count("stream", index, Object.keys(obj).length);
|
||||
});
|
||||
|
||||
pm_count = 0;
|
||||
$.each(unread_filters["private"], function(index, obj) {
|
||||
pm_count += Object.keys(obj).length;
|
||||
});
|
||||
ui.set_count("global", "private", pm_count);
|
||||
}
|
||||
|
||||
function update_selected_message(message, opts) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user