aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2020-01-11 19:10:05 +0000
committerGravatar jesopo2020-01-11 19:10:19 +0000
commitd06d74efb9f844646ae25402c5c60aa4774c8269 (patch)
treede12a9853ae371a79900e26dd41d59d00c1aabe5
parentalso Accept-Language "en" in HTTP requests (0.5 weight) (diff)
signature
default pattern-based commands to expect_output=False
-rw-r--r--modules/ircv3_typing.py7
-rw-r--r--src/core_modules/commands/__init__.py4
2 files changed, 7 insertions, 4 deletions
diff --git a/modules/ircv3_typing.py b/modules/ircv3_typing.py
index ca2fce2b..3c8c9c6d 100644
--- a/modules/ircv3_typing.py
+++ b/modules/ircv3_typing.py
@@ -9,10 +9,13 @@ class Module(ModuleManager.BaseModule):
def _has_tags(self, server):
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")
def preprocess(self, event):
- if (self._has_tags(event["server"]) and
- event["hook"].get_kwarg("expect_output", True)):
+ if self._has_tags(event["server"]) and self._expect_output(event):
event["target"]._typing = True
event["server"].send(self._tagmsg(event["target_str"], "active"),
immediate=True)
diff --git a/src/core_modules/commands/__init__.py b/src/core_modules/commands/__init__.py
index 9822903f..6590a350 100644
--- a/src/core_modules/commands/__init__.py
+++ b/src/core_modules/commands/__init__.py
@@ -320,7 +320,7 @@ class Module(ModuleManager.BaseModule):
self.command(event["server"], event["channel"],
event["target_str"], True, event["user"], command,
args_split, event["line"], hook,
- command_prefix=command_prefix,
+ command_prefix=command_prefix, expect_output=True,
buffer_line=event["buffer_line"])
else:
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["line"], hook, match=match,
message=event["message"], command_prefix="",
- action=event["action"],
+ action=event["action"], expect_output=False,
buffer_line=event["buffer_line"])
if res: