Chats: Support `is_typing` parameter on chat posting
Pleroma chats can benefit from being able to see if the remote chat endpoint has active keyboard activity.
This could be accomplished by doing the following:
- Implementing an
is_typing
parameter on the chat posting endpoint, allowing thecontent
field value to be blank whenis_typing
= true - Implementing an
is_typing
parameter in the streamingpleroma:chat_update
event data, allowing thelast_message
field value to be blank whenis_typing
= true - Make the chat events that include the
is_typing
parameter ephemeral, so that they are only available on the streaming chats channel and are not included in theGetting the messages for a Chat
API
Pleroma FE's could implement methods similar to the following:
On Chat Typing
- Examine keycodes to isolate general typing events
- Generate a chat posting event with
is_typing
param set true - Limit the output of
is_typing
notifications to no more frequently than once every 5 seconds
On Chat Receive
- Examine the content of each
pleroma:chat_update
event foris_typing
= true, and render anis_typing
animation in the chat box, while doing no other processing of that chat event - If
is_typing
= false, process chat as normal - Make the
is_typing
animation disappear after no more than 5 seconds
Following is an example rendering of an active is_typing
chat event using a GIF: