mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 12:56:37 +02:00
irc: rename option irc.network.lag_disconnect to irc.network.lag_reconnect, value is now a number of seconds
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user