mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
fixed action calls, and added a new hook for plugin activation and deactivation
This commit is contained in:
@@ -187,7 +187,7 @@ var fs = require('fs'),
|
|||||||
break;
|
break;
|
||||||
case 'action':
|
case 'action':
|
||||||
async.each(hookList, function(hookObj) {
|
async.each(hookList, function(hookObj) {
|
||||||
if (hookObj.method) hookObj.method.apply(_self.libraries[hookObj.id], args);
|
if (hookObj.method) hookObj.method.call(_self.libraries[hookObj.id], args);
|
||||||
else {
|
else {
|
||||||
if (global.env === 'development') winston.info('[plugins] Expected method \'' + hookObj.method + '\' in plugin \'' + hookObj.id + '\' not found, skipping.');
|
if (global.env === 'development') winston.info('[plugins] Expected method \'' + hookObj.method + '\' in plugin \'' + hookObj.id + '\' not found, skipping.');
|
||||||
}
|
}
|
||||||
@@ -219,6 +219,9 @@ var fs = require('fs'),
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// (De)activation Hooks
|
||||||
|
plugins.fireHook('action:plugin.' + (active ? 'de' : '') + 'activate', id);
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback({
|
callback({
|
||||||
id: id,
|
id: id,
|
||||||
|
|||||||
Reference in New Issue
Block a user