From 68c618887f9e2e551dec467c8b08f7321d3b6e46 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 19 Dec 2016 00:54:20 -0800 Subject: [PATCH] clientbot: auto-attempt SASL when it is introduced in CAP NEW --- protocols/clientbot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 1377cb5..1ffffc5 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -526,9 +526,14 @@ class ClientbotWrapperProtocol(Protocol): # Note: CAP NEW allows capabilities with values (e.g. sasl=mech1,mech2), while CAP DEL # does not. log.debug('(%s) Got new capabilities %s', self.irc.name, args[-1]) - self.ircv3_caps_available.update(self.parseCapabilities(args[-1], None)) + newcaps = self.parseCapabilities(args[-1], None) + self.ircv3_caps_available.update(newcaps) self.requestNewCaps() + # Attempt SASL auth routines if sasl was added/removed + if 'sasl' in newcaps: + self.saslAuth() + elif subcmd == 'DEL': # :irc.example.com CAP modernclient DEL :userhost-in-names multi-prefix away-notify log.debug('(%s) Removing capabilities %s', self.irc.name, args[-1])