summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-08-04 21:25:53 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-08-04 21:25:53 +0200
commit82199f8264846d0a9ab629c5d429b2e99d87080b (patch)
tree2c0b498ee850c9ab5cab87e8f77e0dd12e0bc4fa /src/plugins
parent8f26323bdfc5b4494bb4ead6994c7ea9f9db8fd1 (diff)
downloadweechat-82199f8264846d0a9ab629c5d429b2e99d87080b.zip
irc: remove lag item when a lag is displayed and new lag computed is exactly 0 milliseconds
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-bar-item.c1
-rw-r--r--src/plugins/irc/irc-server.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c
index 740a6f6a9..f168235ac 100644
--- a/src/plugins/irc/irc-bar-item.c
+++ b/src/plugins/irc/irc-bar-item.c
@@ -447,6 +447,7 @@ irc_bar_item_lag (void *data, struct t_gui_bar_item *item,
irc_buffer_get_server_and_channel (buffer, &server, NULL);
if (server
+ && (server->lag >= 0)
&& (server->lag >= weechat_config_integer (irc_config_network_lag_min_show)))
{
snprintf (buf, sizeof (buf),
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index ad2e8e38f..d14c07c03 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -1028,7 +1028,7 @@ irc_server_alloc (const char *name)
new_server->is_away = 0;
new_server->away_message = NULL;
new_server->away_time = 0;
- new_server->lag = 0;
+ new_server->lag = -1;
new_server->lag_check_time.tv_sec = 0;
new_server->lag_check_time.tv_usec = 0;
new_server->lag_next_check = time (NULL) +
@@ -3012,7 +3012,7 @@ irc_server_timer_cb (void *data, int remaining_calls)
(ptr_server->current_address) ?
ptr_server->current_address : "weechat");
gettimeofday (&(ptr_server->lag_check_time), NULL);
- ptr_server->lag = 0;
+ ptr_server->lag = -1;
ptr_server->lag_last_refresh = 0;
}
else
@@ -4658,7 +4658,7 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address,
server->cap_account_notify = 0;
server->is_away = 0;
server->away_time = 0;
- server->lag = 0;
+ server->lag = -1;
server->lag_check_time.tv_sec = 0;
server->lag_check_time.tv_usec = 0;
server->lag_next_check = time (NULL) +