From f7acd2e01b5d4dffa62ad4120b06ac650e5b0393 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 22 Jan 2013 19:33:22 +0000 Subject: [PATCH] revert to older, non-broken ignore. whoops! --- modules/ignore/ignore.js | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/modules/ignore/ignore.js b/modules/ignore/ignore.js index 64f1d27..c456fcb 100644 --- a/modules/ignore/ignore.js +++ b/modules/ignore/ignore.js @@ -9,14 +9,13 @@ var _ = require('underscore')._; var ignore = function(dbot) { var commands = { '~ignore': function(event) { - var user = dbot.api.users.resolveUser(event.server, event.user), - module = event.params[1], - ignorableModules = _.chain(dbot.modules) - .filter(function(module, name) { - return dbot.config[module].ignorable === true; - }) - .pluck('name') - .value(); + var module = event.params[1]; + var ignorableModules = _.chain(dbot.modules) + .filter(function(module, name) { + return dbot.config[module].ignorable === true; + }) + .pluck('name') + .value(); if(_.isUndefined(module)) { event.reply(dbot.t('ignore_usage', { @@ -25,13 +24,13 @@ var ignore = function(dbot) { })); } else { if(_.include(ignorableModules, module)) { - if(_.has(dbot.db.ignores, user) && _.include(dbot.db.ignores[user], module)) { + if(_.has(dbot.db.ignores, event.user) && _.include(dbot.db.ignores[event.user], module)) { event.reply(dbot.t('already_ignoring', { 'user': event.user })); } else { if(_.has(dbot.db.ignores, module)) { - dbot.db.ignores[user].push(module); + dbot.db.ignores[event.user].push(module); } else { - dbot.db.ignores[user] = [module]; + dbot.db.ignores[event.user] = [module]; } dbot.instance.ignoreTag(event.user, module); @@ -47,13 +46,11 @@ var ignore = function(dbot) { }, '~unignore': function(event) { - var user = dbot.api.users.resolveUser(event.server, event.user), - module = event.params[1], - ignoredModules = []; - + var ignoredModules = []; if(_.has(dbot.db.ignores, event.user)) { - ignoredModules = dbot.db.ignores[user]; + ignoredModules = dbot.db.ignores[event.user]; } + var module = event.params[1]; if(_.isUndefined(module)) { event.reply(dbot.t('unignore_usage', { @@ -62,8 +59,8 @@ var ignore = function(dbot) { })); } else { if(_.include(ignoredModules, module)) { - dbot.db.ignores[user].splice(dbot.db.ignores[user].indexOf(module), 1); - dbot.instance.removeIgnore(user, module) + dbot.db.ignores[event.user].splice(dbot.db.ignores[event.user].indexOf(module), 1); + dbot.instance.removeIgnore(event.user, module) event.reply(dbot.t('unignored', { 'user': event.user, 'module': module