From: Darren Date: Tue, 29 Jan 2013 01:28:34 +0000 (+0000) Subject: Updating the nick within IrcConnection on change X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9be602fc8bc7d4f78fd8c48ce781b0671f64d98d;p=KiwiIRC.git Updating the nick within IrcConnection on change --- diff --git a/server/irc/connection.js b/server/irc/connection.js index a61e2c4..311c811 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -82,6 +82,7 @@ IrcConnection.prototype.applyIrcEvents = function () { // TODO: uncomment when using an IrcUser per nick //'user:*:privmsg': onUserPrivmsg, + 'user:*:nick': onUserNick, 'channel:*:part': onUserParts, 'channel:*:quit': onUserParts, 'channel:*:kick': onUserParts @@ -250,6 +251,17 @@ function onUserPrivmsg(event) { } +function onUserNick(event) { + var user; + + // Only deal with messages targetted to us + if (event.nick !== this.nick) + return; + + this.nick = event.newnick; +} + + function onUserParts(event) { // Only deal with ourselves leaving a channel if (event.nick !== this.nick)