From 8af4b0c06d00d8d75f82da914699033c881ee850 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 25 Jun 2016 14:21:18 -0700 Subject: [PATCH] relay: use extra_channels to persistently join the PyLink bot to relay channels Closes #247. --- plugins/relay.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/relay.py b/plugins/relay.py index a956d03..4c0b6b9 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -457,6 +457,8 @@ def initializeChannel(irc, channel): # Send our users and channel modes to the other nets log.debug('(%s) relay.initializeChannel: joining our (%s) users: %s', irc.name, remotenet, irc.channels[channel].users) relayJoins(irc, channel, irc.channels[channel].users, irc.channels[channel].ts) + + world.services['pylink'].extra_channels[irc.name].add(channel) if irc.pseudoclient and irc.pseudoclient.uid not in irc.channels[channel].users: irc.proto.join(irc.pseudoclient.uid, channel) @@ -466,6 +468,7 @@ def removeChannel(irc, channel): return if channel not in map(str.lower, irc.serverdata['channels']): + world.services['pylink'].extra_channels[irc.name].discard(channel) irc.proto.part(irc.pseudoclient.uid, channel, 'Channel delinked.') relay = getRelay((irc.name, channel))