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():
|
for ircobj in world.networkobjects.values():
|
||||||
# Disable auto-connect first by setting the time to negative.
|
# Disable auto-connect first by setting the time to negative.
|
||||||
ircobj.serverdata['autoconnect'] = -1
|
ircobj.serverdata['autoconnect'] = -1
|
||||||
ircobj.disconnect(callhook=False)
|
ircobj.disconnect()
|
||||||
|
|
||||||
def load(irc, source, args):
|
def load(irc, source, args):
|
||||||
"""<plugin name>.
|
"""<plugin name>.
|
||||||
|
@ -28,8 +28,9 @@ def disconnect(irc, source, args):
|
|||||||
irc.reply('Error: No such network "%s" (case sensitive).' % netname)
|
irc.reply('Error: No such network "%s" (case sensitive).' % netname)
|
||||||
return
|
return
|
||||||
irc.reply("Done.")
|
irc.reply("Done.")
|
||||||
|
|
||||||
# Abort the connection! Simple as that.
|
# Abort the connection! Simple as that.
|
||||||
network.aborted.set()
|
network.disconnect()
|
||||||
|
|
||||||
@utils.add_cmd
|
@utils.add_cmd
|
||||||
def connect(irc, source, args):
|
def connect(irc, source, args):
|
||||||
|
@ -204,7 +204,7 @@ def getRemoteSid(irc, remoteirc):
|
|||||||
except ValueError: # Network not initialized yet.
|
except ValueError: # Network not initialized yet.
|
||||||
log.exception('(%s) Failed to spawn server for %r:',
|
log.exception('(%s) Failed to spawn server for %r:',
|
||||||
irc.name, remoteirc.name)
|
irc.name, remoteirc.name)
|
||||||
irc.aborted.set()
|
irc.disconnect()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
irc.servers[sid].remote = remoteirc.name
|
irc.servers[sid].remote = remoteirc.name
|
||||||
@ -981,7 +981,7 @@ def handle_kill(irc, numeric, command, args):
|
|||||||
else:
|
else:
|
||||||
log.error('(%s) Too many kills received for target %s, aborting!',
|
log.error('(%s) Too many kills received for target %s, aborting!',
|
||||||
irc.name, userdata.nick)
|
irc.name, userdata.nick)
|
||||||
irc.aborted.set()
|
irc.disconnect()
|
||||||
killcache[irc.name] += 1
|
killcache[irc.name] += 1
|
||||||
|
|
||||||
# Target user was local.
|
# Target user was local.
|
||||||
|
Loading…
Reference in New Issue
Block a user