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

clientbot: don't send empty MODE hooks when enumerating empty ban lists

This commit is contained in:
James Lu 2017-10-07 21:51:38 -07:00
parent 85ac0bb80a
commit 25ec88c566

View File

@ -1088,8 +1088,10 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
channel = args[1] channel = args[1]
# Send out the hook. We don't worry about repeats since these modes don't need to be # Send out the hook. We don't worry about repeats since these modes don't need to be
# enumerated more than once per JOIN anyways. # enumerated more than once per JOIN anyways.
return {'target': channel, 'parse_as': 'MODE', modes = [('+%s' % banmode, m[1]) for m in self.channels[channel].modes if m[0] == banmode]
'modes': [('+%s' % banmode, m[1]) for m in self.channels[channel].modes if m[0] == banmode]} if modes:
return {'target': channel, 'parse_as': 'MODE',
'modes': modes}
def handle_346(self, *args): def handle_346(self, *args):
""" """