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

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

This commit is contained in:
James Lu 2019-06-23 20:13:04 -07:00
parent df468064d6
commit 61ca8dd781

View File

@ -376,7 +376,7 @@ class ClientbotWrapperProtocol(ClientbotBaseProtocol, 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.