diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index d7949bad..99c2ac36 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -47,6 +47,7 @@ static char* _notify_autocomplete(ProfWin* window, const char* const input, gboo static char* _theme_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _spellcheck_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _autoaway_autocomplete(ProfWin* window, const char* const input, gboolean previous); +static char* _autoping_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _autoconnect_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _account_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _who_autocomplete(ProfWin* window, const char* const input, gboolean previous); @@ -1056,6 +1057,7 @@ cmd_ac_init(void) autocomplete_add(autoping_ac, "set"); autocomplete_add(autoping_ac, "timeout"); + autocomplete_add(autoping_ac, "warning"); autocomplete_add(plugins_ac, "install"); autocomplete_add(plugins_ac, "update"); @@ -1407,6 +1409,7 @@ cmd_ac_init(void) g_hash_table_insert(ac_funcs, "/alias", _alias_autocomplete); g_hash_table_insert(ac_funcs, "/autoaway", _autoaway_autocomplete); g_hash_table_insert(ac_funcs, "/autoconnect", _autoconnect_autocomplete); + g_hash_table_insert(ac_funcs, "/autoping", _autoping_autocomplete); g_hash_table_insert(ac_funcs, "/avatar", _avatar_autocomplete); g_hash_table_insert(ac_funcs, "/ban", _ban_autocomplete); g_hash_table_insert(ac_funcs, "/blocked", _blocked_autocomplete); @@ -1934,7 +1937,6 @@ _cmd_ac_complete_params(ProfWin* window, const char* const input, gboolean previ { "/prefs", prefs_ac }, { "/disco", disco_ac }, { "/room", room_ac }, - { "/autoping", autoping_ac }, { "/mainwin", winpos_ac }, { "/inputwin", winpos_ac }, }; @@ -4264,6 +4266,20 @@ _executable_autocomplete(ProfWin* window, const char* const input, gboolean prev return result; } +static char* +_autoping_autocomplete(ProfWin* window, const char* const input, gboolean previous) +{ + char* result = NULL; + + result = autocomplete_param_with_ac(input, "/autoping", autoping_ac, TRUE, previous); + if (result) { + return result; + } + + result = autocomplete_param_with_func(input, "/autoping warning", prefs_autocomplete_boolean_choice, previous, NULL); + return result; +} + static char* _lastactivity_autocomplete(ProfWin* window, const char* const input, gboolean previous) { diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 146df104..ccd9f1da 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -1965,13 +1965,13 @@ static const struct cmd_t command_defs[] = { CMD_SYN( "/autoping set ", "/autoping timeout ", - "/autoping warning enable|disable") + "/autoping warning on|off") CMD_DESC( "Set the interval between sending ping requests to the server to ensure the connection is kept alive.") CMD_ARGS( { "set ", "Number of seconds between sending pings, a value of 0 disables autoping." }, { "timeout ", "Seconds to wait for autoping responses, after which the connection is considered broken." }, - {"warning enable|disable", "Enable or disable autoping availability warning."}) + { "warning on|off", "Enable or disable autoping availability warning." }) }, { CMD_PREAMBLE("/ping", diff --git a/src/ui/console.c b/src/ui/console.c index 637cdd1c..de565d38 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1704,9 +1704,9 @@ cons_notify_setting(void) cons_show("Subscription requests (/notify sub) : OFF"); if (prefs_get_boolean(PREF_AUTOPING_WARNING)) - cons_show("Autoping warning (/autoping warn) : ON"); + cons_show("Autoping warning (/autoping warning): ON"); else - cons_show("Autoping warning (/autoping warn) : OFF"); + cons_show("Autoping warning (/autoping warning): OFF"); gint remind_period = prefs_get_notify_remind(); if (remind_period == 0) { @@ -2025,9 +2025,9 @@ cons_autoping_setting(void) } if (prefs_get_boolean(PREF_AUTOPING_WARNING)) - cons_show("Autoping warning (/autoping warn) : ON"); + cons_show("Autoping warning (/autoping warning): ON"); else - cons_show("Autoping warning (/autoping warn) : OFF"); + cons_show("Autoping warning (/autoping warning): OFF"); } void diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 6511a49c..67d7ddb8 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -2449,7 +2449,7 @@ _disco_autoping_warning_message(GHashTable* features) cons_show("This server supports XEP-0199: XMPP Ping (better keepalive detection),\n" "but autoping feature is currently disabled in settings.\n" "Consider enabling it (e.g., `/autoping set 30`) for improved connection stability.\n" - "Use `/autoping warn disable` to disable this message."); + "Use `/autoping warning off` to disable this message."); } return 0; }