diff --git a/src/categories.js b/src/categories.js index ba772bb5c1..24efbc4f16 100644 --- a/src/categories.js +++ b/src/categories.js @@ -217,13 +217,7 @@ var db = require('./database'), }; Categories.hasReadCategory = function(cid, uid, callback) { - db.isSetMember('cid:' + cid + ':read_by_uid', uid, function(err, hasRead) { - if(err) { - return callback(false); - } - - callback(hasRead); - }); + db.isSetMember('cid:' + cid + ':read_by_uid', uid, callback); }; Categories.getRecentReplies = function(cid, uid, count, callback) { diff --git a/src/database/mongo.js b/src/database/mongo.js index 92a80cebf7..8c2d527309 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -469,6 +469,24 @@ }); }; + module.isSetMembers = function(key, values, callback) { + for (var i=0; i