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.
This commit is contained in:
Valentin Lorentz 2019-08-31 17:43:13 +02:00
parent 0413304d53
commit b166f4ad5c
1 changed files with 3 additions and 4 deletions

View File

@ -108,12 +108,11 @@ class Network(callbacks.Plugin):
@internationalizeDocstring
def disconnect(self, irc, msg, args, otherIrc, quitMsg):
"""[<network>] [<quit message>]
"""<network> [<quit message>]
Disconnects from the network represented by the network <network>.
If <quit message> is given, quits the network with the given quit
message. <network> 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):