mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 01:19:26 +01:00
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:
parent
84ca6f2ae3
commit
5301390290
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user