fix mark all read

This commit is contained in:
barisusakli
2015-07-28 15:03:20 -04:00
parent 05411651b3
commit 47cc1083df
2 changed files with 5 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ SocketTopics.postcount = function(socket, tid, callback) {
};
SocketTopics.markAsRead = function(socket, tids, callback) {
if(!Array.isArray(tids) || !socket.uid) {
if (!Array.isArray(tids) || !socket.uid) {
return callback(new Error('[[error:invalid-data]]'));
}
@@ -123,14 +123,14 @@ SocketTopics.markAsRead = function(socket, tids, callback) {
};
SocketTopics.markTopicNotificationsRead = function(socket, tid, callback) {
if(!tid || !socket.uid) {
if (!tid || !socket.uid) {
return callback(new Error('[[error:invalid-data]]'));
}
topics.markTopicNotificationsRead(tid, socket.uid);
};
SocketTopics.markAllRead = function(socket, data, callback) {
topics.getLatestTidsFromSet('topics:recent', 0, -1, 'day', function(err, tids) {
db.getSortedSetRevRangeByScore('topics:recent', 0, -1, '+inf', Date.now() - topics.unreadCutoff, function(err, tids) {
if (err) {
return callback(err);
}