Fix registration timeout when SASL is refused

https://github.com/ProgVal/Limnoria/issues/854#issuecomment-70414650
This commit is contained in:
nyuszika7h 2015-01-18 20:35:14 +01:00
parent 7b7a515568
commit bf418756a9

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