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

clientbot: wrap outgoing modes to prevent cutoff

This commit is contained in:
James Lu 2017-09-23 21:54:02 -07:00
parent 6e89dbed24
commit a2a32ed32f

View File

@ -242,7 +242,9 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
log.debug('(%s) mode: filtered modes for %s: %s', self.name, channel, extmodes) log.debug('(%s) mode: filtered modes for %s: %s', self.name, channel, extmodes)
if extmodes: if extmodes:
self.send('MODE %s %s' % (channel, self.join_modes(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))):
self.send('MODE %s %s' % (channel, msg))
# Don't update the state here: the IRCd sill respond with a MODE reply if successful. # Don't update the state here: the IRCd sill respond with a MODE reply if successful.
def nick(self, source, newnick): def nick(self, source, newnick):