Patch userLeave bug (Issue#14
This commit is contained in:
parent
ecc4fb3951
commit
516edf690d
|
@ -326,7 +326,10 @@ Channel.prototype.userLeave = function(user) {
|
|||
if(this.leader == user) {
|
||||
this.changeLeader("");
|
||||
}
|
||||
this.users.splice(this.users.indexOf(user), 1);
|
||||
var idx = this.users.indexOf(user);
|
||||
if(idx >= 0 && idx < this.users.length)
|
||||
this.users.splice(idx, 1);
|
||||
console.log(this.users.length);
|
||||
this.updateUsercount();
|
||||
if(user.name != "") {
|
||||
this.sendAll('userLeave', {
|
||||
|
|
|
@ -33,7 +33,6 @@ function handleKick(chan, user, args) {
|
|||
}
|
||||
if(kickee) {
|
||||
kickee.socket.disconnect();
|
||||
chan.userLeave(kickee);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +49,6 @@ function handleBan(chan, user, args) {
|
|||
if(kickee) {
|
||||
chan.ipbans.push(kickee.ip);
|
||||
kickee.socket.disconnect();
|
||||
chan.userLeave(kickee);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue