From f7dfc38688de38d1a7ece06340715a944be02c97 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 7 Jul 2017 14:10:06 -0700 Subject: [PATCH] relay: only initialize channels that are relevant to the called network in initialize_all() Previously, this would quite often hit channel names that simply don't exist on the target network. --- plugins/relay.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index f510f0c..6349f17 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -37,14 +37,15 @@ def initialize_all(irc): # which would break connections. if world.started.wait(TCONDITION_TIMEOUT): for chanpair, entrydata in db.items(): - # Iterate over all the channels stored in our relay links DB. network, channel = chanpair - # Initialize each relay channel on their home network, and on every linked one too. - initialize_channel(irc, channel) + # Initialize all channels that are relevant to the called network (i.e. channels either hosted there or a relay leaf channels) + if network == irc.name: + initialize_channel(irc, channel) for link in entrydata['links']: network, channel = link - initialize_channel(irc, channel) + if network == irc.name: + initialize_channel(irc, channel) def main(irc=None): """Main function, called during plugin loading at start."""