From bf418756a92447a3e5ceaa15013787a6ff3ab189 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Sun, 18 Jan 2015 20:35:14 +0100 Subject: [PATCH] Fix registration timeout when SASL is refused https://github.com/ProgVal/Limnoria/issues/854#issuecomment-70414650 --- src/irclib.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/irclib.py b/src/irclib.py index 007774a54..64e5762c9 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -962,13 +962,12 @@ class Irc(IrcCommandDispatcher): elif self.sasl_username and self.sasl_password: self.sasl = 'plain' - if self.sasl: - self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('REQ', 'sasl'))) - self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('REQ', 'account-notify'))) self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('REQ', 'extended-join'))) - if not self.sasl: + if self.sasl: + self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('REQ', 'sasl'))) + else: self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',))) if self.password: @@ -1031,6 +1030,11 @@ class Irc(IrcCommandDispatcher): log.warning('%s: Server refused capability %r', self.network, cap) + if cap == 'sasl': + self.queueMsg(ircmsgs.IrcMsg( + command='CAP', + args=('END',))) + def do903(self, msg): log.info('%s: SASL authentication successful', self.network) self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',)))