alexyoung/ircd.js — Issue #16: PMs break when changeing nick without joining channel
Author: treeform
Created: 2011-11-19 00:56:04+00:00
State: open

Repro:
start server
join with two clients
do not join any channels!
/msg eash other
change /nick on one of the clients
now that client cant be msged any more

The irc client gets confused to what the user's nick is because the change nick command is not sent to it.

In this code:

NICK: function(user, nick) {
.....
user.channels.forEach(function(channel) {
channel.send(user.mask, 'NICK', ':' + nick);
});

The new nick command is only sent to channels that nick is in. But if the users is not in any channels he never gets the command that he got the new nick.

I am not sure how to send nick changed command directly to client, i tried this:
user.send(user.mask, 'NICK', ':' + nick);

but it does not seem to work.