From 2ce86eb80359bddd83168453890b5f3cd791faa5 Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Thu, 20 Sep 2012 12:48:51 -0400 Subject: [PATCH 1/2] support a distinct username for NickServ identify msgs --- src/irc.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/irc.coffee b/src/irc.coffee index 2c425d2..701375f 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -93,6 +93,7 @@ class IrcBot extends Adapter server: process.env.HUBOT_IRC_SERVER password: process.env.HUBOT_IRC_PASSWORD nickpass: process.env.HUBOT_IRC_NICKSERV_PASSWORD + nickusername: process.env.HUBOT_IRC_NICKSERV_USERNAME fakessl: process.env.HUBOT_IRC_SERVER_FAKE_SSL? unflood: process.env.HUBOT_IRC_UNFLOOD? debug: process.env.HUBOT_IRC_DEBUG? @@ -118,9 +119,16 @@ class IrcBot extends Adapter user_id = {} if options.nickpass? + identify_args = "" + + if options.nickusername? + identify_args += "#{options.nickusername} " + + identify_args += "#{options.nickpass}" + bot.addListener 'notice', (from, to, text) -> if from is 'NickServ' and text.indexOf('registered') isnt -1 - bot.say 'NickServ', "identify #{options.nickpass}" + bot.say 'NickServ', "identify #{identify_args}" else if options.nickpass and from is 'NickServ' and (text.indexOf('Password accepted') isnt -1 or text.indexOf('identified') isnt -1) From 49dafb5e821cb225df400f258995c07cb9e4702c Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Thu, 20 Sep 2012 13:18:30 -0400 Subject: [PATCH 2/2] listen for 'identify' notice instead of 'register': more generic --- src/irc.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/irc.coffee b/src/irc.coffee index 701375f..c499076 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -127,7 +127,7 @@ class IrcBot extends Adapter identify_args += "#{options.nickpass}" bot.addListener 'notice', (from, to, text) -> - if from is 'NickServ' and text.indexOf('registered') isnt -1 + if from is 'NickServ' and text.indexOf('identify') isnt -1 bot.say 'NickServ', "identify #{identify_args}" else if options.nickpass and from is 'NickServ' and (text.indexOf('Password accepted') isnt -1 or