From ffeb42dde32e70cfc2fdd5801ea2e36e56ca536e Mon Sep 17 00:00:00 2001 From: John Maguire Date: Thu, 21 Mar 2013 01:53:11 -0400 Subject: [PATCH] removes the leading character on a NICK message, only if it's a : to deal with non-conforming IRCd's --- modules/users/users.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/users/users.js b/modules/users/users.js index 69bf4c4..2e6bbbb 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -55,7 +55,9 @@ var users = function(dbot) { channelUsers.push(nick); } } else if(event.action == 'NICK') { - var newNick = event.params.substr(1); + // remove the first character from the NICK message if it is a :, + // due to some IRCd's disregarding RFC 1459 and adding a : + var newNick = (event.params[0] == ":" ? event.params.substr(1) : event.params); if(!this.api.isKnownUser(newNick)) { knownUsers.aliases[newNick] = this.api.resolveUser(event.server, event.user); dbot.api.event.emit('nick_change', [ event.server, newNick ]);