Skip to content

Send +typing tag while commands are processing #2677

@dgw

Description

@dgw

+typing is a client-only tag, but it has a formal spec. Sopel mostly only needs the active state; even commands that produce "no output" likely still send some feedback to IRC ("no results found" or similar), which satisfies one of the conditions for other clients to consider Sopel as "done" typing. (The active state also expires automatically after 6 seconds.)

The most "annoying" part of this would likely be maintaining the +typing=active state during commands that run longer than 4-5 seconds. Sopel would have to send additional notifications no less than 3 seconds apart until all callables in a given context have returned. (Internal tracking of bot.running_triggers could be extended, but I'll bet using a new, totally private, data structure specifically for +typing management would be saner in the long run.)

This is likely best implemented as a new plugin decorator; it would be up to plugin devs to determine which of their plugin callables both produce output and might take long enough to be worth sending a +typing TAGMSG. That gets us out of running introspection tricks at load time to see e.g. which callables call bot.say()—and more importantly, avoids questions like how to handle bot.say() calls with an explicit destination.

A hypothetical @plugin.typing_notifications decorator might also make use of an optional context parameter to change where the TAGMSGs for that callable get sent. Possible values likely limited to a small list of supported and tested Trigger properties, else we quickly reach a need for ugly and dangerous eval() usage…

Likely SHOULD implement #2501 first, to make it easier to avoid sending +typing TAGMSG on servers where it's blocked/ignored.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions