3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-23 10:44:09 +01:00

clientbot: auto-attempt SASL when it is introduced in CAP NEW

This commit is contained in:
James Lu 2016-12-19 00:54:20 -08:00
parent f42d49b8eb
commit 68c618887f

View File

@ -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])