beginning topic searching + new hook

v1.18.x
Julian Lam 11 years ago
parent d25300043c
commit 8296dc5630

@ -417,4 +417,8 @@ SocketTopics.searchTags = function(socket, data, callback) {
topics.searchTags(data, callback);
};
SocketTopics.search = function(socket, data, callback) {
topics.search(data.tid, data.term, callback);
};
module.exports = SocketTopics;

@ -446,4 +446,15 @@ var async = require('async'),
});
};
Topics.search = function(tid, term, callback) {
if (plugins.hasListeners('filter:topic.search')) {
plugins.fireHook('filter:topic.search', {
tid: tid,
term: term
}, callback);
} else {
callback(undefined, []);
}
};
}(exports));

Loading…
Cancel
Save