diff options
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 65feed475..b83b7fc03 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1709,19 +1709,20 @@ IRC_PROTOCOL_CALLBACK(ping) IRC_PROTOCOL_CALLBACK(pong) { struct timeval tv; - int old_lag; IRC_PROTOCOL_MIN_ARGS(0); if (server->lag_check_time.tv_sec != 0) { /* calculate lag (time diff with lag check) */ - old_lag = server->lag; gettimeofday (&tv, NULL); server->lag = (int)(weechat_util_timeval_diff (&(server->lag_check_time), &tv) / 1000); - if (old_lag != server->lag) + if (server->lag != server->lag_displayed) + { + server->lag_displayed = server->lag; weechat_bar_item_update ("lag"); + } /* schedule next lag check */ server->lag_check_time.tv_sec = 0; |