Hello!
I would also love this functinoality, hence I started developing it.
It is working, but I have no idea how to be able to edit the Admin Control Panel in order to set the categories I want to moderate (actually is an array).
Any hint? Thanks in advance.
I think there is an "error" in the source code: the reputation is not taken in count....here below is better explained.
I post the code hoping to be helpful.
I added two variables, the first defining the IDs of the Categories I wnat to moderate, the second (maybe it could be avoided) to store a boolean:
var queuedCategories = [1, 2];
var shouldReallyQueue;
Then I edited the Posts.shouldQueue = function (uid, data, callback) as it follows:
First, in the "const shouldQueue" I replaced the "0" with "meta.config.newbiePostDelayThreshold" (otherwise the reputation is not thaken in count):
const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.newbiePostDelayThreshold || userData.postcount <= 0);
Hence I added a new step in the async.waterfall:
function (result, next) {
shouldReallyQueue = result.shouldQueue;
if (result.data.tid !== undefined)
topics.getTopicField(result.data.tid, 'cid', next);
else
plugins.fireHook('filter:post.shouldQueue', {
categoryId : result.data.cid,
shouldReallyQueue: shouldReallyQueue,
}, next);
},
editing the last check so:
next(null, result.shouldReallyQueue && (queuedCategories.indexOf(result.categoryId) > -1));
Hence, my "Posts.shouldQueue" looks now:
Posts.shouldQueue = function (uid, data, callback) {
async.waterfall([
function (next) {
user.getUserFields(uid, ['uid', 'reputation', 'postcount'], next);
},
function (userData, next) {
const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.newbiePostDelayThreshold || userData.postcount <= 0);
plugins.fireHook('filter:post.shouldQueue', {
shouldQueue: shouldQueue,
uid: uid,
data: data,
}, next);
},
function (result, next) {
shouldReallyQueue = result.shouldQueue;
if (result.data.tid !== undefined)
topics.getTopicField(result.data.tid, 'cid', next);
else
plugins.fireHook('filter:post.shouldQueue', {
categoryId : result.data.cid,
shouldReallyQueue: shouldReallyQueue,
}, next);
},
function (result, next) {
next(null, result.shouldReallyQueue && (queuedCategories.indexOf(result.categoryId) > -1));
},
], callback);
};