1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

irc: store lag in channel and private buffers (local variable "lag"), in addition to the server buffer

This commit is contained in:
Sébastien Helleu
2024-05-16 08:23:28 +02:00
parent 5c79933faa
commit 839ffc4b0c
2 changed files with 20 additions and 2 deletions
+1
View File
@@ -44,6 +44,7 @@ New features::
* api: add support of specifier `%!` for timestamp in function util_strftimeval
* api: add support of base64url in encode/decode functions
* fset: add option `-import` in command `/fset`
* irc: store lag in channel and private buffers (local variable "lag"), in addition to the server buffer
* irc: allow range in commands `/unban` and `/unquiet` (issue #2113)
* irc: rename option irc.color.item_channel_modes to weechat.color.status_modes
* irc: add option `-all` in command `/allchan`, do not execute command on parted channels by default (issue #2085)
+19 -2
View File
@@ -1268,20 +1268,37 @@ irc_server_set_clienttagdeny (struct t_irc_server *server,
void
irc_server_set_lag (struct t_irc_server *server)
{
struct t_irc_channel *ptr_channel;
char str_lag[32];
str_lag[0] = '\0';
if (server->lag >= weechat_config_integer (irc_config_network_lag_min_show))
{
snprintf (str_lag, sizeof (str_lag),
((server->lag_check_time.tv_sec == 0) || (server->lag < 1000)) ?
"%.3f" : "%.0f",
((float)(server->lag)) / 1000);
}
if (str_lag[0])
weechat_buffer_set (server->buffer, "localvar_set_lag", str_lag);
}
else
{
weechat_buffer_set (server->buffer, "localvar_del_lag", "");
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->buffer)
{
if (str_lag[0])
weechat_buffer_set (ptr_channel->buffer, "localvar_set_lag", str_lag);
else
weechat_buffer_set (ptr_channel->buffer, "localvar_del_lag", "");
}
}
weechat_hook_signal_send ("irc_server_lag_changed",
WEECHAT_HOOK_SIGNAL_STRING,
server->name);