mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
refactor: move plugin hook methods to plugin.hooks.*
This commit is contained in:
@@ -36,7 +36,7 @@ module.exports = function (Categories) {
|
||||
if (numRecentReplies > 0) {
|
||||
await db.sortedSetAdd('cid:' + cid + ':recent_tids', Date.now(), tid);
|
||||
}
|
||||
await plugins.fireHook('action:categories.updateRecentTid', { cid: cid, tid: tid });
|
||||
await plugins.hooks.fire('action:categories.updateRecentTid', { cid: cid, tid: tid });
|
||||
};
|
||||
|
||||
Categories.updateRecentTidForCid = async function (cid) {
|
||||
@@ -68,8 +68,8 @@ module.exports = function (Categories) {
|
||||
}
|
||||
const categoriesToLoad = categoryData.filter(c => c && c.numRecentReplies && parseInt(c.numRecentReplies, 10) > 0);
|
||||
let keys = [];
|
||||
if (plugins.hasListeners('filter:categories.getRecentTopicReplies')) {
|
||||
const result = await plugins.fireHook('filter:categories.getRecentTopicReplies', {
|
||||
if (plugins.hooks.hasListeners('filter:categories.getRecentTopicReplies')) {
|
||||
const result = await plugins.hooks.fire('filter:categories.getRecentTopicReplies', {
|
||||
categories: categoriesToLoad,
|
||||
uid: uid,
|
||||
query: query,
|
||||
|
||||
Reference in New Issue
Block a user