From 9be602fc8bc7d4f78fd8c48ce781b0671f64d98d Mon Sep 17 00:00:00 2001 From: Darren Date: Tue, 29 Jan 2013 01:28:34 +0000 Subject: [PATCH] Updating the nick within IrcConnection on change --- server/irc/connection.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- 2.25.1