mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
fixed categories read notification bug
This commit is contained in:
@@ -352,6 +352,8 @@ var RDB = require('./redis.js'),
|
|||||||
|
|
||||||
Categories.hasReadCategories(cids, current_user, function(read_data) {
|
Categories.hasReadCategories(cids, current_user, function(read_data) {
|
||||||
has_read = read_data;
|
has_read = read_data;
|
||||||
|
console.log(cids, read_data);
|
||||||
|
console.log(current_user);
|
||||||
generateCategories();
|
generateCategories();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -186,11 +186,11 @@ marked.setOptions({
|
|||||||
RDB.del('tid:' + tid + ':read_by_uid'); // let everybody know there is an unread post
|
RDB.del('tid:' + tid + ':read_by_uid'); // let everybody know there is an unread post
|
||||||
|
|
||||||
Posts.get_cid_by_pid(pid, function(cid) {
|
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);
|
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
|
// User Details - move this out later
|
||||||
RDB.lpush('uid:' + uid + ':topics', tid);
|
RDB.lpush('uid:' + uid + ':topics', tid);
|
||||||
|
|
||||||
@@ -386,8 +384,13 @@ marked.setOptions({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// let everyone know that there is an unread topic in this category
|
// 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(schema.topics().recent, Date.now(), tid);
|
||||||
//RDB.zadd('topics:active', tid);
|
//RDB.zadd('topics:active', tid);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user