Merge pull request #1013 from nyuszika7h/fix-timeout-on-no-sasl-cap

Fix registration timeout when SASL is refused
This commit is contained in:
Valentin Lorentz 2015-01-19 09:55:00 +01:00
commit ba6f8fa619

View File

@ -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',)))