diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-05-16 08:23:28 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-05-16 08:23:28 +0200 |
commit | 839ffc4b0c6d575b97f834fbc33a49bcbd8f099f (patch) | |
tree | c21a38034c1eb4fc156ce46023cc1f4aedabbf3f /src | |
parent | 5c79933faaf0dc6cbc36cf27edde62fd17d08fce (diff) | |
download | weechat-839ffc4b0c6d575b97f834fbc33a49bcbd8f099f.zip |
irc: store lag in channel and private buffers (local variable "lag"), in addition to the server buffer
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-server.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index a1180236c..dfab7a93d 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -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); - weechat_buffer_set (server->buffer, "localvar_set_lag", str_lag); + } + + 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); |