diff --git a/plugins/relay.py b/plugins/relay.py index 55ff110..da841c1 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -499,21 +499,14 @@ def remove_channel(irc, channel): if irc is None: return - if channel not in map(str.lower, irc.serverdata.get('channels', [])): - world.services['pylink'].extra_channels[irc.name].discard(channel) - if irc.pseudoclient: - irc.proto.part(irc.pseudoclient.uid, channel, 'Channel delinked.') - relay = get_relay((irc.name, channel)) if relay: for user in irc.channels[channel].users.copy(): if not isRelayClient(irc, user): relay_part(irc, channel, user) - # Don't ever part the main client from any of its autojoin channels. else: - if user == irc.pseudoclient.uid and channel in \ - irc.serverdata.get('channels', []): - continue + if user == irc.pseudoclient.uid: + continue # We handle parting the main client later. irc.proto.part(user, channel, 'Channel delinked.') # Don't ever quit it either... if user != irc.pseudoclient.uid and not irc.users[user].channels: @@ -521,6 +514,11 @@ def remove_channel(irc, channel): del relayusers[remoteuser][irc.name] irc.proto.quit(user, 'Left all shared channels.') + if channel not in map(str.lower, irc.serverdata.get('channels', [])): + world.services['pylink'].extra_channels[irc.name].discard(channel) + if irc.pseudoclient: + irc.proto.part(irc.pseudoclient.uid, channel, 'Channel delinked.') + def check_claim(irc, channel, sender, chanobj=None): """ Checks whether the sender of a kick/mode change passes CLAIM checks for