mirror of https://github.com/calzoneman/sync.git
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) {
|
if(this.leader == user) {
|
||||||
this.changeLeader("");
|
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();
|
this.updateUsercount();
|
||||||
if(user.name != "") {
|
if(user.name != "") {
|
||||||
this.sendAll('userLeave', {
|
this.sendAll('userLeave', {
|
||||||
|
|
|
@ -33,7 +33,6 @@ function handleKick(chan, user, args) {
|
||||||
}
|
}
|
||||||
if(kickee) {
|
if(kickee) {
|
||||||
kickee.socket.disconnect();
|
kickee.socket.disconnect();
|
||||||
chan.userLeave(kickee);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +49,6 @@ function handleBan(chan, user, args) {
|
||||||
if(kickee) {
|
if(kickee) {
|
||||||
chan.ipbans.push(kickee.ip);
|
chan.ipbans.push(kickee.ip);
|
||||||
kickee.socket.disconnect();
|
kickee.socket.disconnect();
|
||||||
chan.userLeave(kickee);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue