Only show typing indicators for commands that expect output

This commit is contained in:
jesopo 2019-06-07 15:57:15 +01:00
parent 5f47d86708
commit 8e6835be3c
2 changed files with 7 additions and 4 deletions

View file

@ -136,6 +136,7 @@ class Module(ModuleManager.BaseModule):
return False
message_tags = server.has_capability(MESSAGE_TAGS_CAP)
expect_output = hook.kwargs.get("expect_output", True)
module_name = self._get_prefix(hook) or ""
if not module_name and hasattr(hook.function, "__self__"):
@ -147,6 +148,7 @@ class Module(ModuleManager.BaseModule):
if msgid:
send_tags["+draft/reply"] = msgid
if expect_output:
server.send(utils.irc.protocol.tagmsg(target_str,
{"+draft/typing": "active"}), immediate=True)
@ -216,7 +218,8 @@ class Module(ModuleManager.BaseModule):
target.last_stderr = stderr
ret = new_event.eaten
if message_tags and not stdout.has_text() and not stderr.has_text():
if (expect_output and message_tags and not stdout.has_text() and
not stderr.has_text()):
server.send(utils.irc.protocol.tagmsg(target_str,
{"+draft/typing": "done"}), immediate=True)

View file

@ -44,7 +44,7 @@ class Module(ModuleManager.BaseModule):
if show_duck:
self._trigger_duck(channel)
@utils.hook("command.regex")
@utils.hook("command.regex", expect_output=False)
def channel_message(self, event):
"""
:pattern: .+