set echo-message response ID to the ID of the original message
This commit is contained in:
parent
80ec11966a
commit
81ca751d96
2 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue