diff --git a/src/Channel.py b/src/Channel.py index 11e718e1d..01b0a9f4f 100755 --- a/src/Channel.py +++ b/src/Channel.py @@ -39,6 +39,7 @@ import time import conf import debug import ircdb +import utils import ircmsgs import schedule import ircutils @@ -241,6 +242,24 @@ class Channel(callbacks.Privmsg): irc.reply(msg, conf.replySuccess) unchanignore = privmsgs.checkChannelCapability(unchanignore, 'op') + def chanignores(self, irc, msg, args, channel): + """[] + + Lists the hostmasks that the bot is ignoring on the given channel. + The argument is only necessary if the message isn't being + sent in the channel itself. + """ + channelarg = privmsgs.getArgs(args, needed=0, optional=1) + channel = channelarg or channel + c = ircdb.channels.getChannel(channel) + if len(c.ignores) == 0: + irc.reply(msg, 'I\'m not currently ignoring any hostmasks ' + 'in %r' % channel) + return + irc.reply(msg, utils.commaAndify(map(repr,c.ignores))) + chanignores = privmsgs.checkChannelCapability(chanignores, 'op') + + def addchancapability(self, irc, msg, args, channel): """[] diff --git a/test/test_Channel.py b/test/test_Channel.py index 2534901b6..91c49169a 100644 --- a/test/test_Channel.py +++ b/test/test_Channel.py @@ -77,9 +77,9 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation): def testChanignore(self): self.assertNotError('chanignore foo!bar@baz') + self.assertResponse('chanignores', "'foo!bar@baz'") self.assertNotError('unchanignore foo!bar@baz') self.assertError('permban not!a.hostmask') - # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: