feat: #7957, allow post queue based on group

allow multiple select in ACP pages
This commit is contained in:
Barış Soner Uşaklı
2019-10-28 14:36:14 -04:00
parent 38e9f1d556
commit 1cedc4a0d6
9 changed files with 89 additions and 8 deletions

View File

@@ -16,7 +16,8 @@ const socketHelpers = require('../socket.io/helpers');
module.exports = function (Posts) {
Posts.shouldQueue = async function (uid, data) {
const userData = await user.getUserFields(uid, ['uid', 'reputation', 'postcount']);
const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.postQueueReputationThreshold || userData.postcount <= 0);
const isMemberOfExempt = await groups.isMemberOfAny(userData.uid, meta.config.groupsExemptFromPostQueue);
const shouldQueue = meta.config.postQueue && !isMemberOfExempt && (!userData.uid || userData.reputation < meta.config.postQueueReputationThreshold || userData.postcount <= 0);
const result = await plugins.fireHook('filter:post.shouldQueue', {
shouldQueue: !!shouldQueue,
uid: uid,