From 2cdcd8e1933a03f4423d49df530308d4f9638b08 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 23 Jun 2019 20:13:04 -0700 Subject: [PATCH] clientbot: fix error when MODES is defined in ISUPPORT but given no value (cherry picked from commit 61ca8dd781aa1bc0458d9c4cbb2e6223f0fa0499) This fixes connections to e.g. Oragono --- protocols/clientbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 04153d8..5536871 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -244,7 +244,7 @@ class ClientbotWrapperProtocol(IRCCommonProtocol): log.debug('(%s) mode: filtered modes for %s: %s', self.name, channel, extmodes) if extmodes: bufsize = self.S2S_BUFSIZE - len(':%s MODE %s ' % (self.get_hostmask(self.pseudoclient.uid), channel)) - for msg in self.wrap_modes(extmodes, bufsize, max_modes_per_msg=int(self._caps.get('MODES', 0))): + for msg in self.wrap_modes(extmodes, bufsize, max_modes_per_msg=int(self._caps.get('MODES') or 0)): self.send('MODE %s %s' % (channel, msg)) # Don't update the state here: the IRCd sill respond with a MODE reply if successful.