mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Let's ignore things that look like karma adjustments
This commit is contained in:
parent
94c43c5040
commit
b2b0e26e59
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user