From 98062e88446528dc1f22c80811a58c9f8046a86a Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 22 Aug 2004 07:07:47 +0000 Subject: [PATCH] Converted to an outFilter for greater efficiency (why send a message to myself at all?) and added a check for testing, because otherwise the tests break. --- src/Owner.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Owner.py b/src/Owner.py index 1a158a5b1..5a944f002 100644 --- a/src/Owner.py +++ b/src/Owner.py @@ -200,10 +200,11 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg): continue registerDefaultPlugin(name, s) - def inFilter(self, irc, msg): - if msg.command == 'PRIVMSG' and msg.nick == irc.nick: - self.log.warning('Somehow sent a message to myself: %r.', msg) - return None + def outFilter(self, irc, msg): + if msg.command == 'PRIVMSG' and not world.testing: + if ircutils.strEqual(msg.args[0], irc.nick): + self.log.warning('Tried to send a message to myself: %r.', msg) + return None return msg def isCommand(self, methodName):