From c20d3cafbd8499aa08d2d4e15ec88b1bc18fd320 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 30 Sep 2004 05:29:26 +0000 Subject: [PATCH] Let's make threaded commands tag the message as replied from the start, so things like Infobot won't respond. --- src/callbacks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/callbacks.py b/src/callbacks.py index 20d05c040..6d492c669 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -607,6 +607,12 @@ class IrcObjectProxy(RichReplyMethods): def _callCommand(self, name, cb): try: self.commandMethod = cb.getCommand(name) + if not world.isMainThread(): + # If we're a threaded command, we may not reply quickly enough + # to prevent regexp stuff from running. So we do this to make + # sure it doesn't happen. Neither way (tagging or not tagging) + # is perfect, but this seems better than not tagging. + self.msg.tag('repliedTo') try: cb.callCommand(name, self, self.msg, self.args) except Error, e: