From 269f22a84b758f86cb2edafc736d890def38a9a7 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 10 Aug 2013 16:01:25 +0200 Subject: [PATCH] User: Make arguments handling of '@user hostmask remove' similar to '@user hostmask add' 's. Closes GH-101. --- plugins/User/plugin.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/User/plugin.py b/plugins/User/plugin.py index a0accf602..3bace3407 100644 --- a/plugins/User/plugin.py +++ b/plugins/User/plugin.py @@ -364,15 +364,22 @@ class User(callbacks.Plugin): @internationalizeDocstring def remove(self, irc, msg, args, user, hostmask, password): - """ [] + """[] [] [] Removes the hostmask from the record of the user specified by . If the hostmask given is 'all' then all hostmasks will be removed. The may only be required if the user is not recognized by their hostmask. This message must be sent to the bot privately (not on a channel) since it may contain a - password. + password. If is + not given, it defaults to your current hostmask. If is not + given, it defaults to your currently identified name. This message + must be sent to the bot privately (not on a channel) since it may + contain a password. + """ + if not hostmask: + hostmask = msg.prefix if not user.checkPassword(password) and \ not user.checkHostmask(msg.prefix): u = ircdb.users.getUser(msg.prefix) @@ -391,8 +398,8 @@ class User(callbacks.Plugin): return ircdb.users.setUser(user) irc.replySuccess(s) - remove = wrap(remove, ['private', 'otherUser', 'something', - additional('something', '')]) + remove = wrap(remove, ['private', first('otherUser', 'user'), + optional('something'), additional('something', '')]) class gpg(callbacks.Commands): def __init__(self, *args):