Unread changes closes #6781 (#6783)

* WIP

* more unread work

* faster teaser block handling

if user doesn't have anyone blocked don't check

* much faster filtering of blocked posts

* add missing uid

* add tidsByFilter to return

* dont load all pids to find previous non-blocked teaser

* fix unread filters

they no longer use unread/new unread/watched etc they are query strings now

* shorter nav item code

* add unreplied to filters

fix icons not clearing to 0
dont increment unread counters if there is a reply in a topic where you ignored the topic creator
This commit is contained in:
Barış Soner Uşaklı
2018-09-24 12:58:59 -04:00
committed by GitHub
parent df4f5f6f27
commit cf75c79611
7 changed files with 287 additions and 191 deletions

View File

@@ -261,12 +261,19 @@ SocketUser.getUnreadCounts = function (socket, data, callback) {
return callback(null, {});
}
async.parallel({
unreadTopicCount: async.apply(topics.getTotalUnread, socket.uid),
unreadNewTopicCount: async.apply(topics.getTotalUnread, socket.uid, 'new'),
unreadWatchedTopicCount: async.apply(topics.getTotalUnread, socket.uid, 'watched'),
unreadCounts: async.apply(topics.getUnreadTids, { uid: socket.uid, count: true }),
unreadChatCount: async.apply(messaging.getUnreadCount, socket.uid),
unreadNotificationCount: async.apply(user.notifications.getUnreadCount, socket.uid),
}, callback);
}, function (err, results) {
if (err) {
return callback(err);
}
results.unreadTopicCount = results.unreadCounts[''];
results.unreadNewTopicCount = results.unreadCounts.new;
results.unreadWatchedTopicCount = results.unreadCounts.watched;
results.unreadUnrepliedTopicCount = results.unreadCounts.unreplied;
callback(null, results);
});
};
SocketUser.invite = function (socket, email, callback) {