3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-26 04:32:37 +01:00

Merge pull request #325 from JohnMaguire2013/nick

use new JSBot.parse() NICK action variables.
This commit is contained in:
reality 2013-03-22 04:17:28 -07:00
commit 4a7880d803

View File

@ -55,9 +55,7 @@ var users = function(dbot) {
channelUsers.push(nick); channelUsers.push(nick);
} }
} else if(event.action == 'NICK') { } else if(event.action == 'NICK') {
// remove the first character from the NICK message if it is a :, var newNick = event.newNick;
// 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)) { if(!this.api.isKnownUser(newNick)) {
knownUsers.aliases[newNick] = this.api.resolveUser(event.server, event.user); knownUsers.aliases[newNick] = this.api.resolveUser(event.server, event.user);
dbot.api.event.emit('nick_change', [ event.server, newNick ]); dbot.api.event.emit('nick_change', [ event.server, newNick ]);