mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-21 07:50:45 +01:00
networks: don't allow disconnecting servers marked virtual-server
This commit is contained in:
parent
c5b94cdf21
commit
957697d275
@ -27,10 +27,14 @@ def disconnect(irc, source, args):
|
|||||||
except KeyError: # Unknown network.
|
except KeyError: # Unknown network.
|
||||||
irc.error('No such network "%s" (case sensitive).' % netname)
|
irc.error('No such network "%s" (case sensitive).' % netname)
|
||||||
return
|
return
|
||||||
irc.reply("Done. If you want to reconnect this network, use the 'rehash' command.")
|
|
||||||
log.info('Disconnecting network %r per %s', netname, irc.get_hostmask(source))
|
|
||||||
|
|
||||||
|
if network.has_cap('virtual-server'):
|
||||||
|
irc.error('"%s" is a virtual server and cannot be directly disconnected.' % netname)
|
||||||
|
return
|
||||||
|
|
||||||
|
log.info('Disconnecting network %r per %s', netname, irc.get_hostmask(source))
|
||||||
control.remove_network(network)
|
control.remove_network(network)
|
||||||
|
irc.reply("Done. If you want to reconnect this network, use the 'rehash' command.")
|
||||||
|
|
||||||
@utils.add_cmd
|
@utils.add_cmd
|
||||||
def autoconnect(irc, source, args):
|
def autoconnect(irc, source, args):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user