move echo-message to it's own module, eat events before they hit fake_echo.py

This commit is contained in:
jesopo 2019-06-21 10:41:22 +01:00
parent e76ea39c71
commit 032c67be66
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,11 @@
from src import EventManager, ModuleManager, utils
CAP = utils.irc.Capability("echo-message")
@utils.export("cap", CAP)
class Module(ModuleManager.BaseModule):
@utils.hook("raw.send.privmsg", priority=EventManager.PRIORITY_LOW)
@utils.hook("raw.send.notice", priority=EventManager.PRIORITY_LOW)
def send_message(self, event):
if event["server"].has_capability(CAP):
event.eat()

View file

@ -12,7 +12,6 @@ CAPABILITIES = [
utils.irc.Capability("message-tags", "draft/message-tags-0.2"), utils.irc.Capability("message-tags", "draft/message-tags-0.2"),
utils.irc.Capability("cap-notify"), utils.irc.Capability("cap-notify"),
utils.irc.Capability("batch"), utils.irc.Capability("batch"),
utils.irc.Capability("echo-message"),
utils.irc.Capability(None, "draft/rename"), utils.irc.Capability(None, "draft/rename"),
utils.irc.Capability(None, "draft/setname") utils.irc.Capability(None, "draft/setname")
] ]