From 992c8d8da9eea230ab329017b8a150e59e41701c Mon Sep 17 00:00:00 2001 From: calzoneman Date: Fri, 2 May 2014 12:06:31 -0500 Subject: [PATCH] Fix a case where users could cause duplicate joins --- lib/channel.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/channel.js b/lib/channel.js index a11110c4..86c7cfe8 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -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); };