fixed categories read notification bug

v1.18.x
Baris Usakli 12 years ago
parent aecffecdf1
commit 0e5f280327

@ -352,6 +352,8 @@ var RDB = require('./redis.js'),
Categories.hasReadCategories(cids, current_user, function(read_data) {
has_read = read_data;
console.log(cids, read_data);
console.log(current_user);
generateCategories();
});

@ -186,11 +186,11 @@ marked.setOptions({
RDB.del('tid:' + tid + ':read_by_uid'); // let everybody know there is an unread post
Posts.get_cid_by_pid(pid, function(cid) {
RDB.del('cid:' + cid + ':read_by_uid');
RDB.del('cid:' + cid + ':read_by_uid', function(err, data) {
topics.markAsRead(tid, uid);
});
RDB.zadd('categories:recent_posts:cid:' + cid, Date.now(), pid);
topics.markAsRead(tid, uid);
});

@ -373,8 +373,6 @@ marked.setOptions({
}
});
Topics.markAsRead(tid, uid);
// User Details - move this out later
RDB.lpush('uid:' + uid + ':topics', tid);
@ -386,8 +384,13 @@ marked.setOptions({
});
// let everyone know that there is an unread topic in this category
RDB.del('cid:' + category_id + ':read_by_uid');
RDB.del('cid:' + category_id + ':read_by_uid', function(err, data) {
console.log('deleted');
Topics.markAsRead(tid, uid);
});
RDB.zadd(schema.topics().recent, Date.now(), tid);
//RDB.zadd('topics:active', tid);

Loading…
Cancel
Save