From 0e58d2b8664c6a59841d69087117b29f11f64009 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 28 Aug 2020 11:50:13 -0400 Subject: [PATCH] fix: update post-queue hook names --- src/controllers/mods.js | 5 +++++ src/posts/queue.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/mods.js b/src/controllers/mods.js index 16717e98d9..f1fd83a226 100644 --- a/src/controllers/mods.js +++ b/src/controllers/mods.js @@ -216,6 +216,11 @@ modsController.postQueue = async function (req, res, next) { let postData = await getQueuedPosts(ids); postData = postData.filter(p => p && (isAdminOrGlobalMod || moderatedCids.includes(String(p.category.cid)))); + ({ posts: postData } = await plugins.fireHook('filter:post-queue.get', { + posts: postData, + req: req, + })); + const pageCount = Math.max(1, Math.ceil(postData.length / postsPerPage)); const start = (page - 1) * postsPerPage; const stop = start + postsPerPage - 1; diff --git a/src/posts/queue.js b/src/posts/queue.js index 412d404871..9fd302eeed 100644 --- a/src/posts/queue.js +++ b/src/posts/queue.js @@ -57,7 +57,7 @@ module.exports = function (Posts) { type: type, data: data, }; - payload = await plugins.fireHook('filter:post.queue', payload); + payload = await plugins.fireHook('filter:post-queue.save', payload); payload.data = JSON.stringify(data); await db.sortedSetAdd('post:queue', now, id);