1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

irc: send typing status as TAGMSG to other users

This commit is contained in:
Sébastien Helleu
2021-06-28 20:27:44 +02:00
parent dccf605e66
commit b108e97085
6 changed files with 108 additions and 0 deletions
+28
View File
@@ -3734,6 +3734,34 @@ irc_server_timer_cb (const void *pointer, void *data, int remaining_calls)
ptr_redirect = ptr_next_redirect;
}
/* send typing status on channels */
if (weechat_config_boolean (irc_config_look_send_typing_status))
{
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if ((ptr_channel->typing_status != IRC_CHANNEL_TYPING_STATUS_OFF)
&& (ptr_channel->typing_status_sent + 3 < current_time))
{
irc_server_sendf (
ptr_server,
IRC_SERVER_SEND_OUTQ_PRIO_LOW, NULL,
"@+typing=%s TAGMSG %s",
irc_channel_typing_status_string[ptr_channel->typing_status],
ptr_channel->name);
if (ptr_channel->typing_status == IRC_CHANNEL_TYPING_STATUS_TYPING)
{
ptr_channel->typing_status_sent = current_time;
}
else
{
ptr_channel->typing_status = IRC_CHANNEL_TYPING_STATUS_OFF;
ptr_channel->typing_status_sent = 0;
}
}
}
}
/* purge some data (every 10 minutes) */
if (current_time > ptr_server->last_data_purge + (60 * 10))
{