From f9afcffb3a47fcf20b5b7eac70969f7e8dc5be0c Mon Sep 17 00:00:00 2001 From: Nicolas Coevoet Date: Fri, 9 May 2014 14:39:57 +0200 Subject: [PATCH] Fixes ProgVal/Limnoria#611 --- plugins/Owner/plugin.py | 7 ++++--- src/conf.py | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/Owner/plugin.py b/plugins/Owner/plugin.py index 37704273f..8bdf4f13e 100644 --- a/plugins/Owner/plugin.py +++ b/plugins/Owner/plugin.py @@ -230,9 +230,10 @@ class Owner(callbacks.Plugin): world.starting = False def do376(self, irc, msg): - msg = conf.supybot.networks.get(irc.network).channels.joins() - if msg: - irc.queueMsg(msg) + msgs = conf.supybot.networks.get(irc.network).channels.joins() + if msgs: + for msg in msgs: + irc.queueMsg(msg) do422 = do377 = do376 def setFloodQueueTimeout(self, *args, **kwargs): diff --git a/src/conf.py b/src/conf.py index 5dd1801eb..744128335 100644 --- a/src/conf.py +++ b/src/conf.py @@ -276,6 +276,9 @@ class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf): channels = [] channels_with_key = [] keys = [] + old = None + msgs = [] + msg = None for channel in self(): key = self.key.get(channel)() if key: @@ -283,8 +286,16 @@ class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf): channels_with_key.append(channel) else: channels.append(channel) - if channels_with_key or channels: - return ircmsgs.joins(channels_with_key + channels, keys) + msg = ircmsgs.joins(channels_with_key + channels, keys) + if len(str(msg)) > 512: + msgs.append(old) + keys = [] + channels_with_key = [] + channels = [] + old = msg + if msg: + msgs.append(msg) + return msgs else: # Let's be explicit about it return None