From 285bffb54a659a11a8c592011617b5cd7bcca6af Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Fri, 2 Nov 2012 19:02:33 +0000 Subject: [PATCH] Update way we check if we're SASL authented when we attempt to send PASS command Issue #110 --- server/irc/commands.js | 4 ++-- server/irc/connection.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/irc/commands.js b/server/irc/commands.js index c5207eb..3cbfedd 100644 --- a/server/irc/commands.js +++ b/server/irc/commands.js @@ -514,6 +514,7 @@ var listeners = { 'RPL_SASLAUTHENTICATED':function (command) { this.irc_connection.write('CAP END'); this.irc_connection.cap_negotation = false; + this.irc_connection.sasl = true; this.irc_connection.register(); }, 'RPL_SASLLOGGEDIN': function (command) { @@ -522,11 +523,10 @@ var listeners = { 'ERR_SASLNOTAUTHORISED':function (command) { this.irc_connection.write('CAP END'); this.irc_connection.cap_negotation = false; - this.irc_connection.cap.enabled = _.without(this.irc_connection.cap.enabled, 'sasl'); this.irc_connection.register(); }, 'ERR_SASLABORTED': function (command) { - this.irc_connection.cap.enabled = _.without(this.irc_connection.cap.enabled, 'sasl'); + // noop }, 'ERR_SASLALREADYAUTHED':function (command) { // noop diff --git a/server/irc/connection.js b/server/irc/connection.js index 28e6519..b9c1305 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -111,7 +111,7 @@ IrcConnection.prototype.register = function () { clearTimeout(this.registeration_timeout); this.registration_timeout = null; } - if ((this.password) && (!_.contains(this.cap.enabled, 'sasl'))) { + if ((this.password) && (!this.sasl)) { this.write('PASS ' + this.password); } this.write('NICK ' + this.nick); -- 2.25.1