mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-18 03:31:03 +01:00
small change to new hook
This commit is contained in:
@@ -66,8 +66,14 @@ module.exports = function(Topics) {
|
||||
callback = callback || function() {};
|
||||
if (plugins.hasListeners('filter:topics.updateRecent')) {
|
||||
plugins.fireHook('filter:topics.updateRecent', {tid: tid, timestamp: timestamp}, function(err, data) {
|
||||
if (data && data.tid && data.timestamp) db.sortedSetAdd('topics:recent', data.timestamp, data.tid);
|
||||
callback(err);
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
if (data && data.tid && data.timestamp) {
|
||||
db.sortedSetAdd('topics:recent', data.timestamp, data.tid, callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
db.sortedSetAdd('topics:recent', timestamp, tid, callback);
|
||||
|
||||
Reference in New Issue
Block a user