remove tags from StdOut objects - expose through event_kwargs

This commit is contained in:
jesopo 2019-11-25 16:28:03 +00:00
parent 896dc480a5
commit 4586bc7903
3 changed files with 6 additions and 7 deletions

View file

@ -180,7 +180,7 @@ class Module(ModuleManager.BaseModule):
"target": target, "target_str": target_str,
"is_channel": is_channel, "line": line, "args_split": args_split,
"command": command, "args": " ".join(args_split), "stdout": stdout,
"stderr": stderr}
"stderr": stderr, "tags": {}}
event_kwargs.update(kwargs)
check_assert = lambda check: self._check_assert(event_kwargs, user,
@ -222,9 +222,9 @@ class Module(ModuleManager.BaseModule):
else:
return
self._out(event["server"], event["target"], event["target_str"], obj,
type)
type, event["tags"])
def _out(self, server, target, target_str, obj, type):
def _out(self, server, target, target_str, obj, type, tags):
if type == OutType.OUT:
color = utils.consts.GREEN
else:
@ -240,7 +240,7 @@ class Module(ModuleManager.BaseModule):
raise ValueError("Unknown command-method '%s'" % method)
line = IRCLine.ParsedLine(method, [target_str, line_str],
tags=obj.tags)
tags=tags)
valid, trunc = line.truncate(server.hostmask(),
margin=STR_MORE_LEN)

View file

@ -5,7 +5,6 @@ class StdOut(object):
def __init__(self, prefix):
self.prefix = prefix
self._lines = []
self.tags = {}
self._assured = False
def assure(self):

View file

@ -27,5 +27,5 @@ class Module(ModuleManager.BaseModule):
def postprocess_command(self, event):
msgid = TAG.get_value(event["line"].tags)
if msgid:
event["stdout"].tags["+draft/reply"] = msgid
event["stderr"].tags["+draft/reply"] = msgid
event["tags"]["+draft/reply"] = msgid
event["tags"]["+draft/reply"] = msgid