Don't return data for Topics.updateRecent

Update database if filter passes data back.
v1.18.x
Timothy Fike 9 years ago committed by GitHub
parent fe3fbb7197
commit 9fdd1b6b70

@ -65,7 +65,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);
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);
});
} else {
db.sortedSetAdd('topics:recent', timestamp, tid, callback);
}

Loading…
Cancel
Save