mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 18:06:22 +00:00
OMEMO - trust mode (#1506)
Add OMEMO trust mode capabilities. * ToFu / first usage * blind trust * manual
This commit is contained in:
@@ -8474,6 +8474,37 @@ cmd_omemo_start(ProfWin* window, const char* const command, gchar** args)
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_omemo_trust_mode(ProfWin* window, const char* const command, gchar** args)
|
||||
{
|
||||
#ifdef HAVE_OMEMO
|
||||
|
||||
if (!args[1]) {
|
||||
cons_show("Current trust mode is %s", prefs_get_string(PREF_OMEMO_TRUST_MODE));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[1], "manual") == 0) {
|
||||
cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]);
|
||||
cons_show("You need to trust all OMEMO fingerprints manually");
|
||||
} else if (g_strcmp0(args[1], "firstusage") == 0) {
|
||||
cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]);
|
||||
cons_show("The first seen OMEMO fingerprints will be trusted automatically - new keys must be trusted manually");
|
||||
} else if (g_strcmp0(args[1], "blind") == 0) {
|
||||
cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]);
|
||||
cons_show("ALL OMEMO fingerprints will be trusted automatically");
|
||||
} else {
|
||||
cons_bad_cmd_usage(command);
|
||||
return TRUE;
|
||||
}
|
||||
prefs_set_string(PREF_OMEMO_TRUST_MODE, args[1]);
|
||||
|
||||
#else
|
||||
cons_show("This version of Profanity has not been built with OMEMO support enabled");
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_omemo_char(ProfWin* window, const char* const command, gchar** args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user