|
|
|
@ -46,6 +46,13 @@ Flags.get = function (flagId, callback) {
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
function (flagObj, next) {
|
|
|
|
|
plugins.fireHook('filter:flags.get', {
|
|
|
|
|
flag: flagObj,
|
|
|
|
|
}, function (err, data) {
|
|
|
|
|
next(err, data.flag);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
], callback);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -181,6 +188,13 @@ Flags.list = function (filters, uid, callback) {
|
|
|
|
|
});
|
|
|
|
|
}, next);
|
|
|
|
|
},
|
|
|
|
|
function (flags, next) {
|
|
|
|
|
plugins.fireHook('filter:flags.list', {
|
|
|
|
|
flags: flags,
|
|
|
|
|
}, function (err, data) {
|
|
|
|
|
next(err, data.flags);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
], callback);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -505,7 +519,8 @@ Flags.update = function (flagId, uid, changeset, callback) {
|
|
|
|
|
tasks.push(async.apply(Flags.appendHistory, flagId, uid, changeset));
|
|
|
|
|
|
|
|
|
|
// Fire plugin hook
|
|
|
|
|
tasks.push(async.apply(plugins.fireHook, 'action:flag.update', { flagId: flagId, changeset: changeset, uid: uid }));
|
|
|
|
|
tasks.push(async.apply(plugins.fireHook, 'action:flag.update', { flagId: flagId, changeset: changeset, uid: uid })); // delete @ NodeBB v1.6.0
|
|
|
|
|
tasks.push(async.apply(plugins.fireHook, 'action:flags.update', { flagId: flagId, changeset: changeset, uid: uid }));
|
|
|
|
|
|
|
|
|
|
async.parallel(tasks, function (err) {
|
|
|
|
|
return next(err);
|
|
|
|
@ -644,6 +659,9 @@ Flags.notify = function (flagObj, uid, callback) {
|
|
|
|
|
|
|
|
|
|
plugins.fireHook('action:flag.create', {
|
|
|
|
|
flag: flagObj,
|
|
|
|
|
}); // delete @ NodeBB v1.6.0
|
|
|
|
|
plugins.fireHook('action:flags.create', {
|
|
|
|
|
flag: flagObj,
|
|
|
|
|
});
|
|
|
|
|
notifications.push(notification, results.admins.concat(results.moderators).concat(results.globalMods), callback);
|
|
|
|
|
});
|
|
|
|
@ -673,6 +691,9 @@ Flags.notify = function (flagObj, uid, callback) {
|
|
|
|
|
|
|
|
|
|
plugins.fireHook('action:flag.create', {
|
|
|
|
|
flag: flagObj,
|
|
|
|
|
}); // delete @ NodeBB v1.6.0
|
|
|
|
|
plugins.fireHook('action:flags.create', {
|
|
|
|
|
flag: flagObj,
|
|
|
|
|
});
|
|
|
|
|
notifications.push(notification, results.admins.concat(results.globalMods), callback);
|
|
|
|
|
});
|
|
|
|
|