mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
filter:topics.updateRecent
https://community.nodebb.org/topic/9165/prevent-specific-category-from-showing-in-recent
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
var async = require('async');
|
||||
var db = require('../database');
|
||||
var plugins = require('../plugins');
|
||||
|
||||
module.exports = function(Topics) {
|
||||
var terms = {
|
||||
@@ -63,6 +64,10 @@ module.exports = function(Topics) {
|
||||
|
||||
Topics.updateRecent = function(tid, timestamp, callback) {
|
||||
callback = callback || function() {};
|
||||
if (plugins.hasListeners('filter:topics.updateRecent')) {
|
||||
plugins.fireHook('filter:topics.updateRecent', {tid: tid, timestamp: timestamp}, callback);
|
||||
} else {
|
||||
db.sortedSetAdd('topics:recent', timestamp, tid, callback);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user