mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
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:
parent
17c569ba2c
commit
98062e8844
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user