summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/plugins/irc/irc-config.c29
-rw-r--r--src/plugins/irc/irc-server.c3
3 files changed, 31 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 32b58d3bb..15bc877bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@ Version 0.3.3 (under dev!)
* irc: add new options irc.network.autoreconnect_delay_growing and
irc.network.autoreconnect_delay_max (task #10338)
* irc: add new option weechat.color.status_name_ssl (task #10339)
+* irc: fix bug with option irc.network.lag_check when value is 0 (zero)
* irc: try other nick when connecting to server and receiving message 437
(nick unavailable)
* irc: set buffer local variable "away" when opening new channel (bug #29618)
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index 1501c3f3b..2da039ecd 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -439,6 +439,32 @@ irc_config_change_network_away_check (void *data,
}
/*
+ * irc_config_change_network_lag_check: called when lag check is changed
+ */
+
+void
+irc_config_change_network_lag_check (void *data,
+ struct t_config_option *option)
+{
+ time_t time_next_check;
+ struct t_irc_server *ptr_server;
+
+ /* make C compiler happy */
+ (void) data;
+ (void) option;
+
+ time_next_check = (weechat_config_integer (irc_config_network_lag_check) > 0) ?
+ time (NULL) : 0;
+
+ for (ptr_server = irc_servers; ptr_server;
+ ptr_server = ptr_server->next_server)
+ {
+ if (ptr_server->is_connected)
+ ptr_server->lag_next_check = time_next_check;
+ }
+}
+
+/*
* irc_config_change_network_send_unknown_commands: called when "send_unknown_commands"
* is changed
*/
@@ -1709,7 +1735,8 @@ irc_config_init ()
"lag_check", "integer",
N_("interval between two checks for lag (in seconds, 0 = never "
"check)"),
- NULL, 0, INT_MAX, "60", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "60", NULL, 0, NULL, NULL,
+ &irc_config_change_network_lag_check, NULL, NULL, NULL);
irc_config_network_lag_min_show = weechat_config_new_option (
irc_config_file, ptr_section,
"lag_min_show", "integer",
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 50a0cfa58..3976ff21d 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -1925,7 +1925,8 @@ irc_server_timer_cb (void *data, int remaining_calls)
irc_server_outqueue_send (ptr_server);
/* check for lag */
- if ((ptr_server->lag_check_time.tv_sec == 0)
+ if ((weechat_config_integer (irc_config_network_lag_check) > 0)
+ && (ptr_server->lag_check_time.tv_sec == 0)
&& (new_time >= ptr_server->lag_next_check))
{
irc_server_sendf (ptr_server, 0, "PING %s",