From f42d49b8eb1227e28b5bbea8a5ef6a1c6aa4a242 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 19 Dec 2016 00:52:28 -0800 Subject: [PATCH] cleintbot: only CAP END if we haven't registered yet --- protocols/clientbot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 1598d8d..1377cb5 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -475,7 +475,8 @@ class ClientbotWrapperProtocol(Protocol): """ logfunc = log.info if command == '903' else log.warning logfunc('(%s) %s', self.irc.name, args[-1]) - self.irc.send('CAP END') + if not self.has_eob: + self.irc.send('CAP END') handle_903 = handle_902 = handle_905 = handle_906 = handle_907 = handle_904 def requestNewCaps(self): @@ -512,11 +513,13 @@ 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(): - self.irc.send('CAP END') + 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]) - self.irc.send('CAP END') + if not self.has_eob: + self.irc.send('CAP END') elif subcmd == 'NEW': # :irc.example.com CAP modernclient NEW :batch # :irc.example.com CAP tester NEW :away-notify extended-join