BadWords: Only send a msg stripped of formatting if it had bad words

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-04-14 19:59:59 -04:00
parent 84ca6f2ae3
commit 5301390290

View File

@ -1,5 +1,6 @@
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -91,8 +92,9 @@ class BadWords(callbacks.Privmsg):
s = msg.args[1]
if self.registryValue('stripFormatting'):
s = ircutils.stripFormatting(s)
s = self.regexp.sub(self.sub, s)
msg = ircmsgs.privmsg(msg.args[0], s, msg=msg)
t = self.regexp.sub(self.sub, s)
if t != s:
msg = ircmsgs.privmsg(msg.args[0], t, msg=msg)
return msg
def makeRegexp(self, iterable):