Skip to content

Node.js based forum software built for the modern web

fixed action calls, and added a new hook for plugin activation and deactivation

Julian Lam918826ff485c
diff --git a/src/plugins.js b/src/plugins.js
index fdf72082c8..c887c13185 100644
--- a/src/plugins.js
+++ b/src/plugins.js
@@ -187,7 +187,7 @@ var fs = require('fs'),
break;
case 'action':
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 {
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;
}
+ // (De)activation Hooks
+ plugins.fireHook('action:plugin.' + (active ? 'de' : '') + 'activate', id);
+
if (callback) {
callback({
id: id,