1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-09 21:30:42 +00:00

Move /os into /privacy os

Related to https://github.com/profanity-im/profanity/issues/1836
This commit is contained in:
Michael Vetter 2023-07-25 11:22:42 +02:00
parent feba4b8263
commit f7cce4c5c1
6 changed files with 25 additions and 34 deletions

View File

@ -1075,6 +1075,7 @@ cmd_ac_init(void)
privacy_ac = autocomplete_new();
autocomplete_add(privacy_ac, "logging");
autocomplete_add(privacy_ac, "os");
privacy_log_ac = autocomplete_new();
autocomplete_add(privacy_log_ac, "on");
@ -2031,7 +2032,7 @@ _cmd_ac_complete_params(ProfWin* window, const char* const input, gboolean previ
// autocomplete boolean settings
gchar* boolean_choices[] = { "/beep", "/states", "/outtype", "/flash", "/splash",
"/history", "/vercheck", "/privileges", "/wrap",
"/carbons", "/os", "/slashguard", "/mam", "/silence" };
"/carbons", "/slashguard", "/mam", "/silence" };
for (int i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice, previous, NULL);
@ -4239,6 +4240,11 @@ _privacy_autocomplete(ProfWin* window, const char* const input, gboolean previou
return found;
}
found = autocomplete_param_with_func(input, "/privacy os", prefs_autocomplete_boolean_choice, previous, NULL);
if (found) {
return found;
}
return found;
}

View File

@ -2448,19 +2448,6 @@ static const struct cmd_t command_defs[] = {
"/avatar get thor@valhalla.edda",
"/avatar open freyja@vanaheimr.edda") },
{ CMD_PREAMBLE("/os",
parse_args, 1, 1, &cons_os_setting)
CMD_MAINFUNC(cmd_os)
CMD_TAGS(
CMD_TAG_DISCOVERY)
CMD_SYN(
"/os <on>|<off>")
CMD_DESC(
"Choose whether to include the OS name if a user asks for software information (XEP-0092).")
CMD_ARGS(
{ "on|off", "" })
},
{ CMD_PREAMBLE("/correction",
parse_args, 1, 2, &cons_correction_setting)
CMD_MAINFUNC(cmd_correction)
@ -2723,17 +2710,24 @@ static const struct cmd_t command_defs[] = {
{ CMD_PREAMBLE("/privacy",
parse_args, 2, 3, &cons_privacy_setting)
CMD_SUBFUNCS(
{ "os", cmd_os })
CMD_MAINFUNC(cmd_privacy)
CMD_TAGS(
CMD_TAG_CHAT)
CMD_TAG_CHAT,
CMD_TAG_DISCOVERY)
CMD_SYN(
"/privacy logging on|redact|off")
"/privacy logging on|redact|off",
"/privacy os on|off")
CMD_DESC(
"Configure privacy settings.")
CMD_ARGS(
{ "logging on|redact|off", "Switch chat logging. This will also disable logging in the internally used SQL database. Your messages will not be saved anywhere locally. This might have unintended consequences, such as not being able to decrypt OMEMO encrypted messages received later via MAM, and should be used with caution." })
{ "logging on|redact|off", "Switch chat logging. This will also disable logging in the internally used SQL database. Your messages will not be saved anywhere locally. This might have unintended consequences, such as not being able to decrypt OMEMO encrypted messages received later via MAM, and should be used with caution." },
{ "os on|off", "Choose whether to include the OS name if a user asks for software information (XEP-0092)." }
)
CMD_EXAMPLES(
"/privacy logging off")
"/privacy logging off",
"/privacy os off")
},
// NEXT-COMMAND (search helper)
};

View File

@ -9352,7 +9352,7 @@ cmd_avatar(ProfWin* window, const char* const command, gchar** args)
gboolean
cmd_os(ProfWin* window, const char* const command, gchar** args)
{
_cmd_set_boolean_preference(args[0], "Revealing OS name", PREF_REVEAL_OS);
_cmd_set_boolean_preference(args[1], "Revealing OS name", PREF_REVEAL_OS);
return TRUE;
}

View File

@ -2171,16 +2171,6 @@ cons_color_setting(void)
}
}
void
cons_os_setting(void)
{
if (prefs_get_boolean(PREF_REVEAL_OS)) {
cons_show("Reveal OS name when asked for software version (XEP-0092) (/os) : ON");
} else {
cons_show("Reveal OS name when asked for software version (XEP-0092) (/os) : OFF");
}
}
void
cons_correction_setting(void)
{
@ -2956,4 +2946,10 @@ cons_privacy_setting(void)
} else {
cons_show("Chat history (/history) : OFF");
}
if (prefs_get_boolean(PREF_REVEAL_OS)) {
cons_show("Reveal OS name when asked for software version (XEP-0092) (/privacy os) : ON");
} else {
cons_show("Reveal OS name when asked for software version (XEP-0092) (/privacy os) : OFF");
}
}

View File

@ -334,7 +334,6 @@ void cons_inpblock_setting(void);
void cons_statusbar_setting(void);
void cons_winpos_setting(void);
void cons_color_setting(void);
void cons_os_setting(void);
void cons_correction_setting(void);
void cons_executable_setting(void);
void cons_slashguard_setting(void);

View File

@ -1125,10 +1125,6 @@ cons_tray_setting(void)
{
}
void
cons_os_setting(void)
{
}
void
cons_correction_setting(void)
{
}