mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
beginning topic searching + new hook
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user