3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

relay: raise an error when trying to delink a leaf channel from another leaf network

Previously this would (confusingly) delink the channel from the network the command was called on instead of the intended target.
This commit is contained in:
James Lu 2018-06-08 18:45:45 -07:00
parent 31a0d36990
commit b1248524a9

View File

@ -2381,6 +2381,9 @@ def delink(irc, source, args):
if link[0] == remotenet: if link[0] == remotenet:
remove_channel(world.networkobjects.get(remotenet), link[1]) remove_channel(world.networkobjects.get(remotenet), link[1])
db[entry]['links'].remove(link) db[entry]['links'].remove(link)
elif remotenet:
irc.error('You can only use this delink syntax from the network that owns this channel.')
return
else: else:
remove_channel(irc, channel) remove_channel(irc, channel)
db[entry]['links'].remove((irc.name, channel)) db[entry]['links'].remove((irc.name, channel))