3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-13 13:42:37 +01:00

clientbot: fix error when MODES is defined in ISUPPORT but given no value

(cherry picked from commit 61ca8dd781)

This fixes connections to e.g. Oragono
This commit is contained in:
James Lu 2019-06-23 20:13:04 -07:00
parent fae63d77b2
commit 2cdcd8e193

View File

@ -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.