mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +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
|
continue
|
||||||
registerDefaultPlugin(name, s)
|
registerDefaultPlugin(name, s)
|
||||||
|
|
||||||
def inFilter(self, irc, msg):
|
def outFilter(self, irc, msg):
|
||||||
if msg.command == 'PRIVMSG' and msg.nick == irc.nick:
|
if msg.command == 'PRIVMSG' and not world.testing:
|
||||||
self.log.warning('Somehow sent a message to myself: %r.', msg)
|
if ircutils.strEqual(msg.args[0], irc.nick):
|
||||||
return None
|
self.log.warning('Tried to send a message to myself: %r.', msg)
|
||||||
|
return None
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def isCommand(self, methodName):
|
def isCommand(self, methodName):
|
||||||
|
Loading…
Reference in New Issue
Block a user