Fix a case where users could cause duplicate joins
This commit is contained in:
parent
842fd80e0e
commit
992c8d8da9
|
@ -504,7 +504,7 @@ Channel.prototype.preJoin = function (user, password) {
|
|||
if (self.opts.password !== false && user.rank < 2) {
|
||||
if (password !== self.opts.password) {
|
||||
var checkPassword = function (pw) {
|
||||
if (self.dead) {
|
||||
if (self.dead || user.inChannel()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -513,10 +513,6 @@ Channel.prototype.preJoin = function (user, password) {
|
|||
return;
|
||||
}
|
||||
|
||||
user.socket.listeners("channelPassword").splice(
|
||||
user.socket.listeners("channelPassword").indexOf(checkPassword)
|
||||
);
|
||||
|
||||
user.socket.emit("cancelNeedPassword");
|
||||
self.join(user);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue