From bcde88ab4d11dc0c93665e4b604ef304b9feca2a Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 23 Dec 2012 17:28:36 +0100 Subject: [PATCH] Channel: Add --all parameter to @unban. --- plugins/Channel/plugin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/Channel/plugin.py b/plugins/Channel/plugin.py index def4557a8..2277cf166 100644 --- a/plugins/Channel/plugin.py +++ b/plugins/Channel/plugin.py @@ -407,7 +407,7 @@ class Channel(callbacks.Plugin): @internationalizeDocstring def unban(self, irc, msg, args, channel, hostmask): - """[] [] + """[] [] Unbans on . If is not given, unbans any hostmask currently banned on that matches your current @@ -415,7 +415,11 @@ class Channel(callbacks.Plugin): unexpectedly (or accidentally) banned from the channel. is only necessary if the message isn't sent in the channel itself. """ - if hostmask: + if hostmask == '--all': + bans = irc.state.channels[channel].bans + self._sendMsg(irc, ircmsgs.unbans(channel, bans)) + elif hostmask: + print repr(hostmask) self._sendMsg(irc, ircmsgs.unban(channel, hostmask)) else: bans = [] @@ -432,7 +436,9 @@ class Channel(callbacks.Plugin): (msg.prefix, channel)) unban = wrap(unban, ['op', ('isGranted', _('unban someone')), - additional('hostmask')]) + additional( + first('hostmask', + ('literal', '--all')))]) @internationalizeDocstring def listbans(self, irc, msg, args, channel):