|
|
@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
var async = require('async');
|
|
|
|
var async = require('async');
|
|
|
|
var db = require('../database');
|
|
|
|
var db = require('../database');
|
|
|
|
|
|
|
|
var plugins = require('../plugins');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function(Topics) {
|
|
|
|
module.exports = function(Topics) {
|
|
|
|
var terms = {
|
|
|
|
var terms = {
|
|
|
@ -63,6 +64,10 @@ module.exports = function(Topics) {
|
|
|
|
|
|
|
|
|
|
|
|
Topics.updateRecent = function(tid, timestamp, callback) {
|
|
|
|
Topics.updateRecent = function(tid, timestamp, callback) {
|
|
|
|
callback = callback || function() {};
|
|
|
|
callback = callback || function() {};
|
|
|
|
db.sortedSetAdd('topics:recent', timestamp, tid, callback);
|
|
|
|
if (plugins.hasListeners('filter:topics.updateRecent')) {
|
|
|
|
|
|
|
|
plugins.fireHook('filter:topics.updateRecent', {tid: tid, timestamp: timestamp}, callback);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
db.sortedSetAdd('topics:recent', timestamp, tid, callback);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|