Use the new msg.repliedTo tag.

This commit is contained in:
Jeremy Fincher 2004-09-14 15:09:01 +00:00
parent 4605ce84f8
commit da5fd46bb1
2 changed files with 6 additions and 3 deletions

View File

@ -474,6 +474,9 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
_forceRe = re.compile(r'^no[,: -]+', re.I)
_karmaRe = re.compile(r'^(?:\S+|\(.+\))(?:\+\+|--)(?:\s+)?$')
def doPrivmsg(self, irc, msg):
if msg.repliedTo:
self.log.debug('Returning early from doPrivmsg, msg.repliedTo.')
return
try:
if ircmsgs.isCtcp(msg):
return
@ -595,9 +598,6 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
# Does the dunno'ing for us itself.
self.factoid(key, prepend=random.choice(starts))
def invalidCommand(self, irc, msg, tokens):
irc.finished = True
def doFactoid(self, irc, msg, match):
r"^(.+?)\s+(?<!\\)(was|is|am|were|are)\s+(also\s+)?(.+?)[?!. ]*$"
(key, isAre, also, value) = match.groups()

View File

@ -184,6 +184,9 @@ class SnarfIrc(object):
def urlSnarfer(f):
"""Protects the snarfer from loops and whatnot."""
def newf(self, irc, msg, match, *L, **kwargs):
if msg.repliedTo:
self.log.debug('Not calling snarfer, msg is already repliedTo.')
return
channel = msg.args[0]
if not ircutils.isChannel(channel):
return