mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 19:52:53 +01:00
relay: allow deleting channels created before a casemapping change
This commit is contained in:
parent
4500e27931
commit
0b6845fa92
@ -2368,11 +2368,11 @@ def destroy(irc, source, args):
|
|||||||
|
|
||||||
Removes the given channel from the PyLink Relay, delinking all networks linked to it. If the home network is given and you are logged in as admin, this can also remove relay channels from other networks."""
|
Removes the given channel from the PyLink Relay, delinking all networks linked to it. If the home network is given and you are logged in as admin, this can also remove relay channels from other networks."""
|
||||||
try: # Two args were given: first one is network name, second is channel.
|
try: # Two args were given: first one is network name, second is channel.
|
||||||
channel = irc.to_lower(args[1])
|
channel = args[1]
|
||||||
network = args[0]
|
network = args[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
try: # One argument was given; assume it's just the channel.
|
try: # One argument was given; assume it's just the channel.
|
||||||
channel = irc.to_lower(args[0])
|
channel = args[0]
|
||||||
network = irc.name
|
network = irc.name
|
||||||
except IndexError:
|
except IndexError:
|
||||||
irc.error("Not enough arguments. Needs 1-2: channel, network (optional).")
|
irc.error("Not enough arguments. Needs 1-2: channel, network (optional).")
|
||||||
@ -2389,7 +2389,11 @@ def destroy(irc, source, args):
|
|||||||
else:
|
else:
|
||||||
permissions.check_permissions(irc, source, ['relay.destroy.remote'])
|
permissions.check_permissions(irc, source, ['relay.destroy.remote'])
|
||||||
|
|
||||||
entry = (network, channel)
|
# Allow deleting old channels if the local network's casemapping ever changes
|
||||||
|
if (network, channel) in db:
|
||||||
|
entry = (network, channel)
|
||||||
|
else:
|
||||||
|
entry = (network, irc.to_lower(channel))
|
||||||
if entry in db:
|
if entry in db:
|
||||||
stop_relay(entry)
|
stop_relay(entry)
|
||||||
del db[entry]
|
del db[entry]
|
||||||
|
Loading…
Reference in New Issue
Block a user