diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-config.c | 12 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.h | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.c | 14 |
3 files changed, 16 insertions, 12 deletions
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index d7f90517b..95bbf318f 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -126,7 +126,7 @@ struct t_config_option *irc_config_network_colors_receive; struct t_config_option *irc_config_network_colors_send; struct t_config_option *irc_config_network_lag_check; struct t_config_option *irc_config_network_lag_min_show; -struct t_config_option *irc_config_network_lag_disconnect; +struct t_config_option *irc_config_network_lag_reconnect; struct t_config_option *irc_config_network_lag_refresh_interval; struct t_config_option *irc_config_network_notify_check_ison; struct t_config_option *irc_config_network_notify_check_whois; @@ -2552,12 +2552,12 @@ irc_config_init () N_("minimum lag to show (in milliseconds)"), NULL, 0, 1000 * 3600 * 24, "500", NULL, 0, NULL, NULL, &irc_config_change_network_lag_min_show, NULL, NULL, NULL); - irc_config_network_lag_disconnect = weechat_config_new_option ( + irc_config_network_lag_reconnect = weechat_config_new_option ( irc_config_file, ptr_section, - "lag_disconnect", "integer", - N_("disconnect after important lag (in minutes, 0 = never " - "disconnect)"), - NULL, 0, 60 * 24 * 7, "0", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + "lag_reconnect", "integer", + N_("reconnect to server if lag is greater than this value (in seconds, " + "0 = never reconnect)"), + NULL, 0, 3600 * 24 * 7, "0", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_lag_refresh_interval = weechat_config_new_option ( irc_config_file, ptr_section, "lag_refresh_interval", "integer", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index c14aabb05..47ea1bee6 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -157,7 +157,7 @@ extern struct t_config_option *irc_config_network_colors_receive; extern struct t_config_option *irc_config_network_colors_send; extern struct t_config_option *irc_config_network_lag_check; extern struct t_config_option *irc_config_network_lag_min_show; -extern struct t_config_option *irc_config_network_lag_disconnect; +extern struct t_config_option *irc_config_network_lag_reconnect; extern struct t_config_option *irc_config_network_lag_refresh_interval; extern struct t_config_option *irc_config_network_notify_check_ison; extern struct t_config_option *irc_config_network_notify_check_whois; diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 771368c3f..ddf31a395 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -47,6 +47,7 @@ #include "irc-server.h" #include "irc-buffer.h" #include "irc-channel.h" +#include "irc-color.h" #include "irc-command.h" #include "irc-config.h" #include "irc-input.h" @@ -2821,14 +2822,17 @@ irc_server_timer_cb (void *data, int remaining_calls) weechat_bar_item_update ("lag"); } /* lag timeout? => disconnect */ - if ((weechat_config_integer (irc_config_network_lag_disconnect) > 0) - && (ptr_server->lag / 1000 > weechat_config_integer (irc_config_network_lag_disconnect) * 60)) + if ((weechat_config_integer (irc_config_network_lag_reconnect) > 0) + && (ptr_server->lag / 1000 > weechat_config_integer (irc_config_network_lag_reconnect))) { weechat_printf (ptr_server->buffer, - _("%s%s: lag is high, disconnecting " - "from server..."), + _("%s%s: lag is high, reconnecting to " + "server %s%s%s"), weechat_prefix ("network"), - IRC_PLUGIN_NAME); + IRC_PLUGIN_NAME, + IRC_COLOR_CHAT_SERVER, + ptr_server->name, + IRC_COLOR_RESET); irc_server_disconnect (ptr_server, 0, 1); } } |