mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
more unread changes
This commit is contained in:
@@ -334,7 +334,8 @@ var db = require('./database'),
|
||||
}
|
||||
|
||||
Categories.hasReadCategory(cid, uid, function(hasRead) {
|
||||
categoryData.badgeclass = (parseInt(categoryData.topic_count, 10) === 0 || (hasRead && uid !== 0)) ? '' : 'badge-important';
|
||||
|
||||
categoryData['unread-class'] = (parseInt(categoryData.topic_count, 10) === 0 || (hasRead && parseInt(uid, 10) !== 0)) ? '' : 'unread';
|
||||
|
||||
callback(null, categoryData);
|
||||
});
|
||||
|
||||
@@ -152,12 +152,12 @@ var async = require('async'),
|
||||
posts.create(uid, tid, content, next);
|
||||
},
|
||||
function(postData, next) {
|
||||
|
||||
threadTools.notifyFollowers(tid, postData.pid, uid);
|
||||
|
||||
user.sendPostNotificationToFollowers(uid, tid, postData.pid);
|
||||
|
||||
Topics.markCategoryUnreadForAll(tid, function(err) {
|
||||
next(err, postData);
|
||||
});
|
||||
next(err, postData);
|
||||
},
|
||||
function(postData, next) {
|
||||
Topics.markAsUnreadForAll(tid, function(err) {
|
||||
@@ -972,7 +972,12 @@ var async = require('async'),
|
||||
}
|
||||
|
||||
Topics.markAsUnreadForAll = function(tid, callback) {
|
||||
db.delete('tid:' + tid + ':read_by_uid', callback);
|
||||
db.delete('tid:' + tid + ':read_by_uid', function(err) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
Topics.markCategoryUnreadForAll(tid, callback)
|
||||
});
|
||||
}
|
||||
|
||||
Topics.markAsRead = function(tid, uid, callback) {
|
||||
|
||||
Reference in New Issue
Block a user