mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +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);
|
topics.searchTags(data, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SocketTopics.search = function(socket, data, callback) {
|
||||||
|
topics.search(data.tid, data.term, callback);
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = SocketTopics;
|
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));
|
}(exports));
|
||||||
|
|||||||
Reference in New Issue
Block a user