From b18a61ebd148fb016557381d6aed2d5bde7ada5a Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 4 Sep 2014 13:43:53 +0000 Subject: [PATCH] fix reports and warning --- modules/report/api.js | 3 --- modules/warning/warning.js | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/report/api.js b/modules/report/api.js index a14f905..6967c96 100644 --- a/modules/report/api.js +++ b/modules/report/api.js @@ -41,9 +41,6 @@ var api = function(dbot) { this.db.read('nunsubs', channel.id, function(err, nunsubs) { async.eachSeries(ops, function(nick, next) { dbot.api.users.resolveUser(server, nick, function(user) { - if(!_.include(user.mobile, user.currentNick)) { - perOps = _.without(perOps, user.id); - } if(nunsubs && _.include(nunsubs.users, user.id)) { ops = _.without(ops, user.currentNick); } diff --git a/modules/warning/warning.js b/modules/warning/warning.js index 0525b3c..e5f1a89 100644 --- a/modules/warning/warning.js +++ b/modules/warning/warning.js @@ -6,7 +6,7 @@ var warning = function(dbot) { 'warn': function(server, warner, user, reason, channel, callback) { var adminChannel = dbot.config.servers[server].admin_channel || channel.name; - dbot.api.users.resolveUser(server, user, function(warnee) { + dbot.api.users.resolveUser(server, user, function(err, warnee) { if(warnee) { var id = uuid.v4(); this.db.save('warnings', id, { @@ -52,7 +52,7 @@ var warning = function(dbot) { '~rmwarning': function(event) { var warning = null; - dbot.api.users.resolveUser(event.server, event.input[1], function(warnee) { + dbot.api.users.resolveUser(event.server, event.input[1], function(err, warnee) { if(warnee) { this.db.search('warnings', { 'warnee': warnee.id, 'reason': event.input[2] }, function(result) { warning = result; @@ -75,7 +75,7 @@ var warning = function(dbot) { var warnee = event.params[1], server = event.server; - dbot.api.users.resolveUser(server, warnee, function(warnee) { + dbot.api.users.resolveUser(server, warnee, function(err, warnee) { var warnings = 0; this.db.search('warnings', { 'server': server,