diff options
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.c | 21 |
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index f45ffed98..fde8c9465 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -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) 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); |