From f92e37704bd8ed203a4aa09a7d09b63fc8f76443 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 3 Oct 2004 03:43:36 +0000 Subject: [PATCH] Fixed a bug with outFilter losing tags. --- plugins/BadWords.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/BadWords.py b/plugins/BadWords.py index bd61635c3..ea4b4f83c 100644 --- a/plugins/BadWords.py +++ b/plugins/BadWords.py @@ -45,6 +45,7 @@ import supybot.conf as conf import supybot.utils as utils import supybot.ircdb as ircdb import supybot.ircmsgs as ircmsgs +from supybot.commands import wrap import supybot.ircutils as ircutils import supybot.privmsgs as privmsgs import supybot.registry as registry @@ -131,7 +132,7 @@ class BadWords(privmsgs.CapabilityCheckingPrivmsg): s = msg.args[1] s = ircutils.stripFormatting(s) s = self.regexp.sub(self.sub, s) - msg = ircmsgs.privmsg(msg.args[0], s) + msg = ircmsgs.privmsg(msg.args[0], s, msg=msg) return msg def makeRegexp(self, iterable): @@ -152,27 +153,30 @@ class BadWords(privmsgs.CapabilityCheckingPrivmsg): irc.reply(utils.commaAndify(L)) else: irc.reply('I\'m not currently censoring any bad words.') + list = wrap(list) - def add(self, irc, msg, args): + def add(self, irc, msg, args, words): """ [ ...] Adds all s to the list of words the bot isn't to say. """ set = self.words() - set.update(args) + set.update(words) self.words.setValue(set) irc.replySuccess() + add = wrap(add, ['something+']) - def remove(self, irc, msg, args): + def remove(self, irc, msg, args, words): """ [ ...] Removes a s from the list of words the bot isn't to say. """ set = self.words() - for word in args: + for word in words: set.discard(word) self.words.setValue(set) irc.replySuccess() + remove = wrap(remove, ['something+']) Class = BadWords