diff --git a/modules/ircv3_echo_message.py b/modules/ircv3_echo_message.py new file mode 100644 index 00000000..3db7a6a9 --- /dev/null +++ b/modules/ircv3_echo_message.py @@ -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() diff --git a/modules/line_handler/ircv3.py b/modules/line_handler/ircv3.py index 93b814c8..23d14ed5 100644 --- a/modules/line_handler/ircv3.py +++ b/modules/line_handler/ircv3.py @@ -12,7 +12,6 @@ CAPABILITIES = [ utils.irc.Capability("message-tags", "draft/message-tags-0.2"), utils.irc.Capability("cap-notify"), utils.irc.Capability("batch"), - utils.irc.Capability("echo-message"), utils.irc.Capability(None, "draft/rename"), utils.irc.Capability(None, "draft/setname") ]