diff options
| author | 2019-06-07 16:21:19 +0100 | |
|---|---|---|
| committer | 2019-06-07 16:21:19 +0100 | |
| commit | 321bd7acf4ca750fa9a1c3918354c498804d839a (patch) | |
| tree | 874102b723be013e6614c1aba88c6e7c0449375c /modules/commands | |
| parent | actually return `ret` (diff) | |
| signature | ||
check stdout/stderr `has_text()` before .send() gets rid of it
Diffstat (limited to 'modules/commands')
| -rw-r--r-- | modules/commands/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py index 598da563..8af9231d 100644 --- a/modules/commands/__init__.py +++ b/modules/commands/__init__.py @@ -157,6 +157,7 @@ class Module(ModuleManager.BaseModule): command_method = self._command_method(target, server) ret = False + had_out = False if hook.kwargs.get("remove_empty", True): args_split = list(filter(None, args_split)) @@ -211,6 +212,7 @@ class Module(ModuleManager.BaseModule): stderr.write(str(e)) if not hook.kwargs.get("skip_out", False): + had_out = stdout.has_text() or stderr.has_text() command_method = self._command_method(target, server) stdout.send(command_method) stderr.send(command_method) @@ -218,8 +220,7 @@ class Module(ModuleManager.BaseModule): target.last_stderr = stderr ret = new_event.eaten - if (expect_output and message_tags and not stdout.has_text() and - not stderr.has_text()): + if expect_output and message_tags and not had_out: server.send(utils.irc.protocol.tagmsg(target_str, {"+draft/typing": "done"}), immediate=True) |
