privilege fix for single category check

This commit is contained in:
barisusakli
2014-08-02 19:45:13 -04:00
parent e7700a3fde
commit e420ee5fb6
7 changed files with 62 additions and 76 deletions

View File

@@ -73,12 +73,10 @@ SocketTopics.markAsRead = function(socket, tid) {
topics.markAsRead(tid, socket.uid, function(err) {
topics.pushUnreadCount(socket.uid);
topics.markTopicNotificationsRead(tid, socket.uid);
});
};
SocketTopics.markTidsRead = function(socket, tids, callback) {
if (!Array.isArray(tids)) {
return callback(new Error('[[error:invalid-data]]'));
}
@@ -98,6 +96,13 @@ SocketTopics.markTidsRead = function(socket, tids, callback) {
});
};
SocketTopics.markTopicNotificationsRead = function(socket, tid, callback) {
if(!tid || !socket.uid) {
return callback(new Error('[[error:invalid-data]]'));
}
topics.markTopicNotificationsRead(tid, socket.uid);
};
SocketTopics.markAllRead = function(socket, data, callback) {
topics.getUnreadTids(socket.uid, 0, -1, function(err, tids) {
if (err) {