From 2fc5fc699204c53ac08bbb2d6568674371f566a0 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 25 May 2013 22:09:07 +0000 Subject: [PATCH] remove command hooks [#471] --- modules/command/api.js | 10 ---------- modules/command/command.js | 5 ----- modules/poll/poll.js | 4 ++-- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/modules/command/api.js b/modules/command/api.js index 4cf92a9..adaedac 100644 --- a/modules/command/api.js +++ b/modules/command/api.js @@ -53,16 +53,6 @@ var api = function(dbot) { applies = true; } return applies; - }, - - 'addHook': function(command, callback) { - console.log('adding hook'); - if(_.has(dbot.commands, command)) { - if(!_.has(dbot.commands[command], 'hooks')) { - dbot.commands[command].hooks = []; - } - dbot.commands[command].hooks.push(callback); - } } }; }; diff --git a/modules/command/command.js b/modules/command/command.js index a950199..1066018 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -32,11 +32,6 @@ var command = function(dbot) { try { var command = dbot.commands[commandName]; var results = command.apply(dbot.modules[command.module], [event]); - if(_.has(command, 'hooks') && results !== false) { - _.each(command['hooks'], function(hook) { - hook.apply(hook.module, _.values(results)); - }, this); - } } catch(err) { if(dbot.config.debugMode == true) { var stack = err.stack.split('\n').slice(1, dbot.config.debugLevel + 1); diff --git a/modules/poll/poll.js b/modules/poll/poll.js index 1110faa..d54e8f1 100644 --- a/modules/poll/poll.js +++ b/modules/poll/poll.js @@ -15,8 +15,8 @@ var poll = function(dbot) { }; this.onLoad = function() { - dbot.api.command.addHook('~setaliasparent', this.internalAPI.updatePollNicks); - dbot.api.command.addHook('~mergeusers', this.internalAPI.updatePollNicks); + // dbot.api.command.addHook('~setaliasparent', this.internalAPI.updatePollNicks); + // dbot.api.command.addHook('~mergeusers', this.internalAPI.updatePollNicks); }.bind(this); };