Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deletion of Array elements #172

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function Client(server, nick, opt) {
var channel = self.chans[channame];
if ( 'string' == typeof channel.users[message.nick] ) {
channel.users[message.args[0]] = channel.users[message.nick];
delete channel.users[message.nick];
channel.users.splice(message.nick, 1);
channels.push(channame);
}
}
Expand Down Expand Up @@ -426,11 +426,11 @@ function Client(server, nick, opt) {
}
if ( self.nick == message.nick ) {
var channel = self.chanData(message.args[0]);
delete self.chans[channel.key];
self.chans.splice(channel.key, 1);
}
else {
var channel = self.chanData(message.args[0]);
delete channel.users[message.nick];
channel.users.splice(message.nick, 1);
}
break;
case "KICK":
Expand All @@ -443,11 +443,11 @@ function Client(server, nick, opt) {

if ( self.nick == message.args[1] ) {
var channel = self.chanData(message.args[0]);
delete self.chans[channel.key];
self.chans.splice(channel.key, 1);
}
else {
var channel = self.chanData(message.args[0]);
delete channel.users[message.args[1]];
channel.users.splice(message.args[1], 1);
}
break;
case "KILL":
Expand All @@ -457,7 +457,7 @@ function Client(server, nick, opt) {
if ( self.chans[channel].users[nick])
channels.push(channel);

delete self.chans[channel].users[nick];
self.chans[channel].users.splice(nick, 1);
}
self.emit('kill', nick, message.args[1], channels, message);
break;
Expand Down Expand Up @@ -503,7 +503,7 @@ function Client(server, nick, opt) {
for ( var channame in self.chans ) {
var channel = self.chans[channame];
if ( 'string' == typeof channel.users[message.nick] ) {
delete channel.users[message.nick];
channel.users.splice(message.nick, 1);
channels.push(channame);
}
}
Expand Down Expand Up @@ -809,7 +809,7 @@ Client.prototype._clearWhoisData = function(nick) { // {{{
// Ensure that at least the nick exists before trying to return
this._addWhoisData(nick, 'nick', nick);
var data = this._whoisData[nick];
delete this._whoisData[nick];
this._whoisData.splice(nick, 1);
return data;
} // }}}
Client.prototype._handleCTCP = function(from, to, text, type) {
Expand Down