From b166f4ad5c18810607ddd97d7474f8c3005093a3 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 31 Aug 2019 17:43:13 +0200 Subject: [PATCH] Network: Make the 'network' argument of @disconnect mandatory. Closes GH-161. Otherwise, if it's provided and the network doesn't exist (or the bot isn't currently connected to it), it's interpreted as being a quit message and disconnects from the current network. --- plugins/Network/plugin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/Network/plugin.py b/plugins/Network/plugin.py index 449029a68..8f97351d9 100644 --- a/plugins/Network/plugin.py +++ b/plugins/Network/plugin.py @@ -108,12 +108,11 @@ class Network(callbacks.Plugin): @internationalizeDocstring def disconnect(self, irc, msg, args, otherIrc, quitMsg): - """[] [] + """ [] Disconnects from the network represented by the network . If is given, quits the network with the given quit - message. is only necessary if the network is different - from the network the command is sent on. + message. """ standard_msg = conf.supybot.plugins.Owner.quitMsg() if standard_msg: @@ -125,7 +124,7 @@ class Network(callbacks.Plugin): if otherIrc != irc: irc.replySuccess(_('Disconnection to %s initiated.') % otherIrc.network) - disconnect = wrap(disconnect, ['owner', 'networkIrc', additional('text')]) + disconnect = wrap(disconnect, ['owner', ('networkIrc', True), additional('text')]) @internationalizeDocstring def reconnect(self, irc, msg, args, otherIrc, quitMsg):