diff --git a/src/irclib.py b/src/irclib.py index 504f74c1b..82997942c 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -930,7 +930,7 @@ class Irc(IrcCommandDispatcher): else: if self.sasl_password: if not self.sasl_username: - log.error('SASL username is not set, unable to identify.') + log.warning('SASL username is not set, unable to identify.') else: auth_string = base64.b64encode('\x00'.join([ self.sasl_username, @@ -941,8 +941,6 @@ class Irc(IrcCommandDispatcher): self.queueMsg(ircmsgs.IrcMsg(command="CAP", args=('REQ', 'sasl'))) log.debug('Using SASL mechanism PLAIN.') self.queueMsg(ircmsgs.IrcMsg(command="AUTHENTICATE", args=('PLAIN',))) - log.info('Authenticating using SASL.') - self.queueMsg(ircmsgs.IrcMsg(command="AUTHENTICATE", args=(auth_string,))) if self.password: log.info('Sending PASS command, not logging the password.') self.queueMsg(ircmsgs.password(self.password)) @@ -952,6 +950,12 @@ class Irc(IrcCommandDispatcher): self.ident, self.user) self.queueMsg(ircmsgs.user(self.ident, self.user)) + def doAuthenticate(self, msg): + if msg.args[0] == '+': + log.info('Authenticating using SASL.') + self.queueMsg(ircmsgs.IrcMsg(command="AUTHENTICATE", args=(auth_string,))) + + def do903(self, msg): log.info('%s: SASL authentication successful' % self.network) self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',)))