mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
plugins: use irc.disconnect() to disconnect networks (#152)
This commit is contained in:
parent
f70ca54ae4
commit
989f1f4f64
@ -177,7 +177,7 @@ def shutdown(irc, source, args):
|
||||
for ircobj in world.networkobjects.values():
|
||||
# Disable auto-connect first by setting the time to negative.
|
||||
ircobj.serverdata['autoconnect'] = -1
|
||||
ircobj.disconnect(callhook=False)
|
||||
ircobj.disconnect()
|
||||
|
||||
def load(irc, source, args):
|
||||
"""<plugin name>.
|
||||
|
@ -28,8 +28,9 @@ def disconnect(irc, source, args):
|
||||
irc.reply('Error: No such network "%s" (case sensitive).' % netname)
|
||||
return
|
||||
irc.reply("Done.")
|
||||
|
||||
# Abort the connection! Simple as that.
|
||||
network.aborted.set()
|
||||
network.disconnect()
|
||||
|
||||
@utils.add_cmd
|
||||
def connect(irc, source, args):
|
||||
|
@ -204,7 +204,7 @@ def getRemoteSid(irc, remoteirc):
|
||||
except ValueError: # Network not initialized yet.
|
||||
log.exception('(%s) Failed to spawn server for %r:',
|
||||
irc.name, remoteirc.name)
|
||||
irc.aborted.set()
|
||||
irc.disconnect()
|
||||
return
|
||||
else:
|
||||
irc.servers[sid].remote = remoteirc.name
|
||||
@ -981,7 +981,7 @@ def handle_kill(irc, numeric, command, args):
|
||||
else:
|
||||
log.error('(%s) Too many kills received for target %s, aborting!',
|
||||
irc.name, userdata.nick)
|
||||
irc.aborted.set()
|
||||
irc.disconnect()
|
||||
killcache[irc.name] += 1
|
||||
|
||||
# Target user was local.
|
||||
|
Loading…
Reference in New Issue
Block a user