Skip to content

Commit

Permalink
fix room join for freenode channels
Browse files Browse the repository at this point in the history
I had this problem that hubot wouldn't join rooms and just idled connected to
the freenode servers. I tracked it down to the `NOTICE` message parsing. The
freenode servers would not send 'Password accepted' but rather something like
'You are now identified for ...'. I added a condition to take that into
account.
  • Loading branch information
mrtazz committed Nov 30, 2011
1 parent 03638b0 commit e2df065
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class IrcBot extends Adapter
bot.addListener 'notice', (from, to, text) ->
if from is 'NickServ' and text.indexOf('registered') isnt -1
bot.say 'NickServ', "identify #{options.nickpass}"
else if options.nickpass and from is 'NickServ' and text.indexOf('Password accepted') isnt -1
else if options.nickpass and from is 'NickServ' and
(text.indexOf('Password accepted') isnt -1 or
text.indexOf('identified') isnt -1)
for room in options.rooms
@join room

Expand Down

0 comments on commit e2df065

Please sign in to comment.