|
|
@ -128,11 +128,16 @@ marked.setOptions({
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Topics.getTotalUnread = function(uid, callback) {
|
|
|
|
Topics.getTotalUnread = function(uid, callback) {
|
|
|
|
RDB.zcount('topics:recent', '-inf', '+inf', function(err, count) {
|
|
|
|
RDB.zrevrange('topics:recent', 0, 21, function (err, tids) {
|
|
|
|
if (err) count = 0;
|
|
|
|
Topics.hasReadTopics(tids, uid, function(read) {
|
|
|
|
console.log(count);
|
|
|
|
var unreadTids = tids.filter(function(tid, index, self) {
|
|
|
|
|
|
|
|
return read[index] === 0;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
callback(count);
|
|
|
|
callback({
|
|
|
|
|
|
|
|
count: unreadTids.length
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|