|
|
|
@ -353,14 +353,25 @@ var async = require('async'),
|
|
|
|
|
return parseInt(read[index], 10) === 0;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
unreadTids.push.apply(unreadTids, newtids);
|
|
|
|
|
// Filter out topics that belong to categories that this user cannot access
|
|
|
|
|
async.filter(newtids, function(tid, next) {
|
|
|
|
|
threadTools.privileges(tid, uid, function(err, privileges) {
|
|
|
|
|
if (!err && privileges.read) {
|
|
|
|
|
next(true);
|
|
|
|
|
} else {
|
|
|
|
|
next(false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, function(newtids) {
|
|
|
|
|
unreadTids.push.apply(unreadTids, newtids);
|
|
|
|
|
|
|
|
|
|
if(continueCondition()) {
|
|
|
|
|
start = stop + 1;
|
|
|
|
|
stop = start + 19;
|
|
|
|
|
}
|
|
|
|
|
if(continueCondition()) {
|
|
|
|
|
start = stop + 1;
|
|
|
|
|
stop = start + 19;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
callback(null);
|
|
|
|
|
callback(null);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|