From 9b8148f2e7bc8f3afe929f03d979418e1bd73989 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sun, 23 Jun 2013 20:40:56 +0000 Subject: [PATCH 1/3] Update strings.json --- modules/ignore/strings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ignore/strings.json b/modules/ignore/strings.json index abcdd07..bd29941 100644 --- a/modules/ignore/strings.json +++ b/modules/ignore/strings.json @@ -57,7 +57,7 @@ }, "ban_usage": { "en": "{user}: Usage: ~ban [user] [module/command]. Use * for all modules and commands.", - "cy": "{user}: Defnydd: ~ban [defnyddiwr] [modiwl/gorchymyn]. Defnyddio * am pob modiwlau a gorchmynion." + "cy": "{user}: Defnydd: ~ban [defnyddiwr] [modiwl/gorchymyn]. Defnyddio * am pob modiwlau a gorchmynion.", "nl": "{user}: Gebruik: ~ban [gebruiker] [module/commando]. Gebruik * voor alle modules en alle commandos.", "de": "{user}: Benutzung ~ban [Benutzer] [module/Befehl]. Benutze * für alle Module und Befehle." }, From c1cd9755e4fa7a7a21a31db3e0c18afa9aa66dee Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 27 Jun 2013 18:06:49 +0000 Subject: [PATCH 2/3] expose hostmask stuff in commands [Close #518] --- modules/nickserv/nickserv.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/nickserv/nickserv.js b/modules/nickserv/nickserv.js index 6feafd9..8ca294b 100644 --- a/modules/nickserv/nickserv.js +++ b/modules/nickserv/nickserv.js @@ -24,6 +24,33 @@ var nickserv = function(dbot) { } }; + this.commands = { + '~auth': function(event) { + var user = event.params[1] || event.user; + this.api.auth(event.server, user, function(isAuthed) { + if(isAuthed) { + event.reply(dbot.t('authed', { 'nick': user })); + } else { + event.reply(dbot.t('not_authed', { 'nick': user })); + } + }); + }, + + '~hostmask': function(event) { + var user = event.params[1] || event.user; + this.api.getUserHost(event.server, user, function(host) { + if(host) { + event.reply(dbot.t('hostmask', { + 'nick': user, + 'host': host + })); + } else { + event.reply(dbot.t('no_hostmask', { 'nick': user })); + } + }); + } + }; + this.listener = function(event) { if(event.action == 'NOTICE') { var nickserv = dbot.config.servers[event.server].nickserv, @@ -33,7 +60,7 @@ var nickserv = function(dbot) { if(event.user == nickserv) { var info = event.params.match(statusRegex); if(info && _.has(this.authStack, event.server)) { - if(info[2] == acceptableState ) { + if(info[2] == acceptableState) { this.authStack[event.server][info[1]](true); } else { this.authStack[event.server][info[1]](false); From 812504dcb22cae8c8689098555dcddcb3941b21b Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 27 Jun 2013 18:08:45 +0000 Subject: [PATCH 3/3] forgot to commit new nickserv.strings files --- modules/nickserv/strings.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules/nickserv/strings.json diff --git a/modules/nickserv/strings.json b/modules/nickserv/strings.json new file mode 100644 index 0000000..90e72c4 --- /dev/null +++ b/modules/nickserv/strings.json @@ -0,0 +1,14 @@ +{ + "authed": { + "en": "{nick} is authed with nickserv." + }, + "not_authed": { + "en": "{nick} is not authed with nickserv." + }, + "hostmask": { + "en": "Hostmask for {nick}: {host}" + }, + "no_hostmask": { + "en": "No hostmask could be found for {nick}" + } +}