Moved setting otr.warn -> enc.warn

This commit is contained in:
James Booth
2015-06-21 21:07:57 +01:00
parent e72ddf5488
commit 446027b950
18 changed files with 46 additions and 121 deletions

View File

@@ -668,6 +668,14 @@ static struct cmd_t command_defs[] =
"If the terminal does not support sounds, it may attempt to flash the screen instead.",
NULL } } },
{ "/encwarn",
cmd_encwarn, parse_args, 1, 1, &cons_encwarn_setting,
{ "/encwarn on|off", "Titlebar encryption warning.",
{ "/encwarn on|off",
"---------------",
"Enabled or disable the unencrypted warning message in the titlebar.",
NULL } } },
{ "/presence",
cmd_presence, parse_args, 1, 1, &cons_presence_setting,
{ "/presence on|off", "Show the contacts presence in the titlebar.",
@@ -1483,7 +1491,6 @@ cmd_init(void)
autocomplete_add(otr_ac, "untrust");
autocomplete_add(otr_ac, "secret");
autocomplete_add(otr_ac, "log");
autocomplete_add(otr_ac, "warn");
autocomplete_add(otr_ac, "libver");
autocomplete_add(otr_ac, "policy");
autocomplete_add(otr_ac, "question");
@@ -1957,7 +1964,7 @@ _cmd_complete_parameters(ProfWin *window, const char * const input)
// autocomplete boolean settings
gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype",
"/flash", "/splash", "/chlog", "/grlog", "/mouse", "/history",
"/vercheck", "/privileges", "/presence", "/wrap", "/winstidy", "/carbons" };
"/vercheck", "/privileges", "/presence", "/wrap", "/winstidy", "/carbons", "/encwarn" };
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice);
@@ -2460,12 +2467,6 @@ _otr_autocomplete(ProfWin *window, const char * const input)
return found;
}
found = autocomplete_param_with_func(input, "/otr warn",
prefs_autocomplete_boolean_choice);
if (found) {
return found;
}
found = autocomplete_param_with_ac(input, "/otr", otr_ac, TRUE);
if (found) {
return found;

View File

@@ -4326,11 +4326,6 @@ cmd_otr(ProfWin *window, gchar **args, struct cmd_help_t help)
}
return TRUE;
} else if (strcmp(args[0], "warn") == 0) {
gboolean result = _cmd_set_boolean_preference(args[1], help,
"OTR warning message", PREF_OTR_WARN);
return result;
} else if (strcmp(args[0], "libver") == 0) {
char *version = otr_libotr_version();
cons_show("Using libotr version %s", version);
@@ -4608,6 +4603,12 @@ cmd_otr(ProfWin *window, gchar **args, struct cmd_help_t help)
#endif
}
gboolean
cmd_encwarn(ProfWin *window, gchar **args, struct cmd_help_t help)
{
return _cmd_set_boolean_preference(args[0], help, "Encryption warning message", PREF_ENC_WARN);
}
// helper function for status change commands
static void
_update_presence(const resource_presence_t resource_presence,

View File

@@ -146,6 +146,7 @@ gboolean cmd_wrap(ProfWin *window, gchar **args, struct cmd_help_t help);
gboolean cmd_time(ProfWin *window, gchar **args, struct cmd_help_t help);
gboolean cmd_resource(ProfWin *window, gchar **args, struct cmd_help_t help);
gboolean cmd_inpblock(ProfWin *window, gchar **args, struct cmd_help_t help);
gboolean cmd_encwarn(ProfWin *window, gchar **args, struct cmd_help_t help);
gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args);