set echo-message response ID to the ID of the original message

This commit is contained in:
jesopo 2019-06-21 18:22:36 +01:00
parent 80ec11966a
commit 81ca751d96
2 changed files with 12 additions and 1 deletions

View file

@ -9,3 +9,13 @@ class Module(ModuleManager.BaseModule):
def send_message(self, event):
if event["server"].has_capability(CAP):
event.eat()
@utils.hook("preprocess.send.privmsg")
@utils.hook("preprocess.send.notice")
@utils.hook("preprocess.send.tagmsg")
def preprocess_send(self, event):
if event["server"].has_capability(CAP):
event["events"].on("labeled-response").hook(self.on_echo)
def on_echo(self, event):
event["responses"][0].id = event["line"].id

View file

@ -56,7 +56,8 @@ class Module(ModuleManager.BaseModule):
return
cached = server._label_cache.pop(label)
cached.events.on("labeled-response").call(lines=lines)
cached.events.on("labeled-response").call(line=cached.line,
responses=lines)
for label, other_cached in server._label_cache.items():
other_cached.labels_since += 1