3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

clientbot: make unattended SASL reauth optional

This commit is contained in:
James Lu 2016-12-19 01:06:49 -08:00
parent 68c618887f
commit a96bb0ce11
2 changed files with 9 additions and 2 deletions

View File

@ -298,6 +298,12 @@ servers:
#sasl_username: "mIRCsKripterz"
#sasl_password: "DownLoaditn00b!!!"
# If this option is enabled, the bot will attempt SASL authentication even after it's
# connected, as services become available throughout netsplits and reconnects.
# Note: This requires an IRC server capable of IRCv3.2 cap-notify and sasl:
# InspIRCd 3.x and charybdis 4+ (and derivatives) are some compatible examples (as of 2016-12-19)
#sasl_reauth: true
# Autoconnect works like usual.
autoconnect: 30

View File

@ -530,8 +530,9 @@ class ClientbotWrapperProtocol(Protocol):
self.ircv3_caps_available.update(newcaps)
self.requestNewCaps()
# Attempt SASL auth routines if sasl was added/removed
if 'sasl' in newcaps:
# Attempt SASL auth routines when sasl is added/removed, if doing so is enabled.
if 'sasl' in newcaps and self.irc.serverdata.get('sasl_reauth'):
log.debug('(%s) Attempting SASL reauth due to CAP NEW', self.irc.name)
self.saslAuth()
elif subcmd == 'DEL':