Skip to content
Browse files

When a NICK command is received, update self.nick if needed.

This should fix #93, though I don't know if arbitrarily changing
self.nick in the middle of a session breaks other expectations about
the way the code works.
  • Loading branch information...
1 parent 886461c commit 0f8df959eb0fc6374df16716b3e2a8f26889f475 @toolness committed Jun 27, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/irc.js
View
4 lib/irc.js
@@ -180,6 +180,10 @@ function Client(server, nick, opt) {
});
break;
case "NICK":
+ if ( message.nick == self.nick )
+ // the user just changed their own nick
+ self.nick = message.args[0];
+
if ( self.opt.debug )
util.log("NICK: " + message.nick + " changes nick to " + message.args[0]);

0 comments on commit 0f8df95

Please sign in to comment.
Something went wrong with that request. Please try again.