fixed read status in categories

v1.18.x
Baris Soner Usakli 12 years ago
parent ed99f2671e
commit 719182e3a8

@ -128,7 +128,7 @@ var RDB = require('./redis.js'),
} }
function hasReadTopic(next) { function hasReadTopic(next) {
topics.hasReadTopics([topicData.tid], current_user, function(hasRead) { topics.hasReadTopic(topicData.tid, current_user, function(hasRead) {
next(null, hasRead); next(null, hasRead);
}); });
} }

@ -245,6 +245,18 @@ marked.setOptions({
}); });
} }
Topics.hasReadTopic = function(tid, uid, callback) {
RDB.sismember(schema.topics(tid).read_by_uid, uid, function(err, hasRead) {
if(err === null) {
callback(hasRead);
}
else {
console.log(err);
callback(false);
}
});
}
Topics.getTeasers = function(tids, callback) { Topics.getTeasers = function(tids, callback) {
var requests = []; var requests = [];
if (Array.isArray(tids)) { if (Array.isArray(tids)) {

Loading…
Cancel
Save