Fix a case where users could cause duplicate joins

This commit is contained in:
calzoneman 2014-05-02 12:06:31 -05:00
parent 842fd80e0e
commit 992c8d8da9
1 changed files with 1 additions and 5 deletions

View File

@ -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);
};