ox: Add /ox log command

This commit is contained in:
Michael Vetter
2022-05-05 23:41:45 +02:00
parent 66eeccf408
commit d011d6707c
6 changed files with 41 additions and 1 deletions

View File

@@ -7725,6 +7725,31 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
}
return TRUE;
}
gboolean
cmd_ox_log(ProfWin* window, const char* const command, gchar** args)
{
char* choice = args[1];
if (g_strcmp0(choice, "on") == 0) {
prefs_set_string(PREF_OX_LOG, "on");
cons_show("OX messages will be logged as plaintext.");
if (!prefs_get_boolean(PREF_CHLOG)) {
cons_show("Chat logging is currently disabled, use '/logging chat on' to enable.");
}
} else if (g_strcmp0(choice, "off") == 0) {
prefs_set_string(PREF_OX_LOG, "off");
cons_show("OX message logging disabled.");
} else if (g_strcmp0(choice, "redact") == 0) {
prefs_set_string(PREF_OX_LOG, "redact");
cons_show("OX messages will be logged as '[redacted]'.");
if (!prefs_get_boolean(PREF_CHLOG)) {
cons_show("Chat logging is currently disabled, use '/logging chat on' to enable.");
}
} else {
cons_bad_cmd_usage(command);
}
return TRUE;
}
#endif // HAVE_LIBGPGME
gboolean