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.

This commit is contained in:
Jeremy Fincher 2004-08-22 07:07:47 +00:00
parent 17c569ba2c
commit 98062e8844
1 changed files with 5 additions and 4 deletions

View File

@ -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):