added API call for total unread topics; moved unread notification parsing to client side

also fixed a bug where the new notification icon glow would disappear on
page refresh even if there were existing notifications.
This commit is contained in:
psychobunny
2013-08-21 23:34:35 +08:00
parent 5ab1758d28
commit 746fa93c80
6 changed files with 30 additions and 12 deletions

View File

@@ -127,6 +127,15 @@ marked.setOptions({
});
}
Topics.getTotalUnread = function(uid, callback) {
RDB.zcount('topics:recent', '-inf', '+inf', function(err, count) {
if (err) count = 0;
console.log(count);
callback(count);
});
};
Topics.getUnreadTopics = function(uid, start, stop, callback) {
var unreadTopics = {