From c5a3d75d29bb8f23f02b95127f88bdd33a7e6a3d Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 28 Aug 2013 17:35:11 +0000 Subject: [PATCH] fix warn --- modules/warning/strings.json | 2 +- modules/warning/warning.js | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/warning/strings.json b/modules/warning/strings.json index 1df8640..cbd4b17 100644 --- a/modules/warning/strings.json +++ b/modules/warning/strings.json @@ -10,7 +10,7 @@ "it": "{user} a {num} avvertenze. Ulteriori informazioni si trovano a {url}" }, "warn_notify": { - "en": "Attention: {warner} has issued a warning to {warnee} for \"{reason}.\" More info can be found at {url}", + "en": "{warner} has issued a warning to {warnee} for \"{reason}.\" More info can be found at {url}", "fr": "Attention : {warner} a donné un avertissement à {warnee} pour \"{reason}.\". Plus d'informations peuvent être trouvées ici : {url}", "it": "Attenzione : {warner} ha dato un' avvertenza a {warnee} per \"{reason}.\". Ulterior informazioni si trovano a {url}" } diff --git a/modules/warning/warning.js b/modules/warning/warning.js index b079384..11e6c8a 100644 --- a/modules/warning/warning.js +++ b/modules/warning/warning.js @@ -7,7 +7,7 @@ var warning = function(dbot) { var warner = event.rUser, server = event.server, reason = event.input[2], - adminChannel = dbot.config.servers[server].admin_channel; + adminChannel = dbot.config.servers[server].admin_channel || event.channel.name; dbot.api.users.resolveUser(server, event.input[1], function(warnee) { if(warnee) { @@ -27,12 +27,9 @@ var warning = function(dbot) { 'url': dbot.api.web.getUrl('warning/' + server + '/' + warnee.primaryNick) }); - if(_.isUndefined(adminChannel)) { - adminChannel = event.channel.name; - } - dbot.api.report.notify(server, adminChannel, notifyString); + + dbot.api.report.notify('warn', event.server, event.rUser, adminChannel, notifyString); dbot.say(server, adminChannel, notifyString); - dbot.say(server, warnee.currentNick, notifyString); }); } else { event.reply(dbot.t('warnee_not_found', { 'user': event.input[1] }));