1
0
Fork 0

Add OMEMO in prefs command

This commit is contained in:
Paul Fariello 2019-04-01 13:53:29 +02:00
parent 65b3f82c5f
commit e7be3a605b
6 changed files with 34 additions and 2 deletions

View File

@ -244,6 +244,7 @@ cmd_ac_init(void)
autocomplete_add(prefs_ac, "presence");
autocomplete_add(prefs_ac, "otr");
autocomplete_add(prefs_ac, "pgp");
autocomplete_add(prefs_ac, "omemo");
notify_ac = autocomplete_new();
autocomplete_add(notify_ac, "chat");

View File

@ -2134,7 +2134,7 @@ static struct cmd_t command_defs[] =
CMD_MAINFUNC(cmd_prefs)
CMD_NOTAGS
CMD_SYN(
"/prefs [ui|desktop|chat|log|conn|presence|otr|pgp]")
"/prefs [ui|desktop|chat|log|conn|presence|otr|pgp|omemo]")
CMD_DESC(
"Show preferences for different areas of functionality. "
"Passing no arguments shows all preferences.")
@ -2146,7 +2146,8 @@ static struct cmd_t command_defs[] =
{ "conn", "Connection handling preferences." },
{ "presence", "Chat presence preferences." },
{ "otr", "Off The Record preferences." },
{ "pgp", "OpenPGP preferences." })
{ "pgp", "OpenPGP preferences." },
{ "omemo", "OMEMO preferences." })
CMD_NOEXAMPLES
},

View File

@ -1679,6 +1679,10 @@ cmd_prefs(ProfWin *window, const char *const command, gchar **args)
cons_show("");
cons_show_pgp_prefs();
cons_show("");
} else if (strcmp(args[0], "omemo") == 0) {
cons_show("");
cons_show_omemo_prefs();
cons_show("");
} else {
cons_bad_cmd_usage(command);
}

View File

@ -1998,6 +1998,28 @@ cons_show_pgp_prefs(void)
cons_alert();
}
void
cons_show_omemo_prefs(void)
{
cons_show("OMEMO preferences:");
cons_show("");
char *log_value = prefs_get_string(PREF_OMEMO_LOG);
if (strcmp(log_value, "on") == 0) {
cons_show("OMEMO logging (/omemo log) : ON");
} else if (strcmp(log_value, "off") == 0) {
cons_show("OMEMO logging (/omemo log) : OFF");
} else {
cons_show("OMEMO logging (/omemo log) : Redacted");
}
prefs_free_string(log_value);
char ch = prefs_get_omemo_char();
cons_show("OMEMO char (/omemo char) : %c", ch);
cons_alert();
}
void
cons_show_themes(GSList *themes)
{
@ -2072,6 +2094,8 @@ cons_prefs(void)
cons_show("");
cons_show_pgp_prefs();
cons_show("");
cons_show_omemo_prefs();
cons_show("");
cons_alert();
}

View File

@ -252,6 +252,7 @@ void cons_show_presence_prefs(void);
void cons_show_connection_prefs(void);
void cons_show_otr_prefs(void);
void cons_show_pgp_prefs(void);
void cons_show_omemo_prefs(void);
void cons_show_account(ProfAccount *account);
void cons_debug(const char *const msg, ...);
void cons_show_error(const char *const cmd, ...);

View File

@ -338,6 +338,7 @@ void cons_show_presence_prefs(void) {}
void cons_show_connection_prefs(void) {}
void cons_show_otr_prefs(void) {}
void cons_show_pgp_prefs(void) {}
void cons_show_omemo_prefs(void) {}
void cons_show_account(ProfAccount *account)
{