diff options
| author | 2019-07-07 11:29:22 +0100 | |
|---|---|---|
| committer | 2019-07-07 11:29:22 +0100 | |
| commit | 84df0cb054cd9dfe5bc6f17f9fe73ddb4ed47ebd (patch) | |
| tree | 7d5d15228f755a3198236302d47f8dea3e565363 | |
| parent | support rss/atom feeds that have no feed title (diff) | |
| signature | ||
only set last_stdout/last_stderr when there's actually output
| -rw-r--r-- | modules/commands/__init__.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py index 6c8e9760..d24813b8 100644 --- a/modules/commands/__init__.py +++ b/modules/commands/__init__.py @@ -189,7 +189,7 @@ class Module(ModuleManager.BaseModule): command_method = self._command_method(target, server) ret = False - had_out = False + has_out = False if hook.get_kwarg("remove_empty", True): args_split = list(filter(None, args_split)) @@ -237,15 +237,16 @@ class Module(ModuleManager.BaseModule): return True if not hook.get_kwarg("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) - target.last_stdout = stdout - target.last_stderr = stderr + has_out = stdout.has_text() or stderr.has_text() + if has_out: + command_method = self._command_method(target, server) + stdout.send(command_method) + stderr.send(command_method) + target.last_stdout = stdout + target.last_stderr = stderr ret = new_event.eaten - if expect_output and message_tags and not had_out: + if expect_output and message_tags and not has_out: server.send(utils.irc.protocol.tagmsg(target_str, {"+draft/typing": "done"}), immediate=True) |
