From b2b0e26e590c82cb68e2c6aba34343d093b7b5ca Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 27 Aug 2004 16:05:33 +0000 Subject: [PATCH] Let's ignore things that look like karma adjustments --- plugins/Infobot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/Infobot.py b/plugins/Infobot.py index e2cc154f8..68afe01ce 100755 --- a/plugins/Infobot.py +++ b/plugins/Infobot.py @@ -432,10 +432,15 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp): return s _forceRe = re.compile(r'^no[,: -]+', re.I) + _karmaRe = re.compile(r'^\S+(?:\+\+|--)(?:\s+)?$') def doPrivmsg(self, irc, msg): try: if ircmsgs.isCtcp(msg): return + # probably not necessary, but we'll see what the debug logs show + if getattr(irc, 'finished', False): + self.log.debug('Received a finished irc object. Bailing.') + return maybeAddressed = callbacks.addressed(irc.nick, msg, whenAddressedByNick=True) if maybeAddressed: @@ -443,6 +448,9 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp): payload = maybeAddressed else: payload = msg.args[1] + if self._karmaRe.search(payload): + self.log.debug('Not snarfing a karma adjustment.') + return payload = self.normalize(payload) maybeForced = self._forceRe.sub('', payload) if maybeForced != payload: