Node.js based forum software built for the modern web
filter:topics.updateRecent
Timothy Fikefe3fbb71970e
diff --git a/src/topics/recent.js b/src/topics/recent.jsindex 7139f58991..f2961f9b22 100644--- a/src/topics/recent.js+++ b/src/topics/recent.js@@ -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() {};- 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);+ }};};