3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

cleintbot: only CAP END if we haven't registered yet

This commit is contained in:
James Lu 2016-12-19 00:52:28 -08:00
parent 880714b2f2
commit f42d49b8eb

View File

@ -475,6 +475,7 @@ class ClientbotWrapperProtocol(Protocol):
"""
logfunc = log.info if command == '903' else log.warning
logfunc('(%s) %s', self.irc.name, args[-1])
if not self.has_eob:
self.irc.send('CAP END')
handle_903 = handle_902 = handle_905 = handle_906 = handle_907 = handle_904
@ -512,10 +513,12 @@ class ClientbotWrapperProtocol(Protocol):
# Only send CAP END immediately if SASL is disabled. Otherwise, wait for the 90x responses
# to do so.
if not self.saslAuth():
if not self.has_eob:
self.irc.send('CAP END')
elif subcmd == 'NAK':
log.warning('(%s) Got NAK for IRCv3 capabilities %s, even though they were supposedly available',
self.irc.name, args[-1])
if not self.has_eob:
self.irc.send('CAP END')
elif subcmd == 'NEW':
# :irc.example.com CAP modernclient NEW :batch