diff --git a/src/Channel.py b/src/Channel.py index 5980264e2..daa396865 100755 --- a/src/Channel.py +++ b/src/Channel.py @@ -84,7 +84,7 @@ class Channel(callbacks.Privmsg): mode = wrap(mode, [('checkChannelCapability', 'op'), ('haveOp', 'change the mode'), - many('text')]) + many('something')]) def limit(self, irc, msg, args, channel, limit): """[] [] @@ -393,17 +393,31 @@ class Channel(callbacks.Privmsg): additional('text')]) def unban(self, irc, msg, args, channel, hostmask): - """[] + """[] [] - Unbans on . Especially useful for unbanning - yourself when you get unexpectedly (or accidentally) banned from - the channel. is only necessary if the message isn't sent - in the channel itself. + Unbans on . If is not given, unbans + any hostmask currently banned on that matches your current + hostmask. Especially useful for unbanning yourself when you get + unexpectedly (or accidentally) banned from the channel. is + only necessary if the message isn't sent in the channel itself. """ - irc.queueMsg(ircmsgs.unban(channel, hostmask)) + if hostmask: + irc.queueMsg(ircmsgs.unban(channel, hostmask)) + else: + bans = [] + for banmask in irc.state.channels[channel].bans: + if ircutils.hostmaskPatternEqual(banmask, msg.prefix): + bans.append(banmask) + if bans: + irc.queueMsg(ircmsgs.unbans(channel, bans)) + irc.replySuccess('All bans on %s matching %s ' + 'have been removed.' % (channel, msg.prefix)) + else: + irc.error('No bans matching %s were found on %s.' % + (msg.prefix, channel)) unban = wrap(unban, [('checkChannelCapability', 'op'), ('haveOp', 'unban someone'), - 'hostmask']) + additional('hostmask')]) def invite(self, irc, msg, args, channel, nick): """[]