default pattern-based commands to expect_output=False

This commit is contained in:
jesopo 2020-01-11 19:10:05 +00:00
parent ba958f341b
commit d06d74efb9
2 changed files with 7 additions and 4 deletions

View file

@ -9,10 +9,13 @@ class Module(ModuleManager.BaseModule):
def _has_tags(self, server): def _has_tags(self, server):
return server.has_capability(CAP) return server.has_capability(CAP)
def _expect_output(self, event):
kwarg = event["hook"].get_kwarg("expect_output", None)
return kwarg if not kwarg is None else event["expect_output"]
@utils.hook("preprocess.command") @utils.hook("preprocess.command")
def preprocess(self, event): def preprocess(self, event):
if (self._has_tags(event["server"]) and if self._has_tags(event["server"]) and self._expect_output(event):
event["hook"].get_kwarg("expect_output", True)):
event["target"]._typing = True event["target"]._typing = True
event["server"].send(self._tagmsg(event["target_str"], "active"), event["server"].send(self._tagmsg(event["target_str"], "active"),
immediate=True) immediate=True)

View file

@ -320,7 +320,7 @@ class Module(ModuleManager.BaseModule):
self.command(event["server"], event["channel"], self.command(event["server"], event["channel"],
event["target_str"], True, event["user"], command, event["target_str"], True, event["user"], command,
args_split, event["line"], hook, args_split, event["line"], hook,
command_prefix=command_prefix, command_prefix=command_prefix, expect_output=True,
buffer_line=event["buffer_line"]) buffer_line=event["buffer_line"])
else: else:
self.events.on("unknown.command").call(server=event["server"], self.events.on("unknown.command").call(server=event["server"],
@ -345,7 +345,7 @@ class Module(ModuleManager.BaseModule):
event["target_str"], True, event["user"], command, event["target_str"], True, event["user"], command,
"", event["line"], hook, match=match, "", event["line"], hook, match=match,
message=event["message"], command_prefix="", message=event["message"], command_prefix="",
action=event["action"], action=event["action"], expect_output=False,
buffer_line=event["buffer_line"]) buffer_line=event["buffer_line"])
if res: if res: