From 3d2f999efb9995e003f0d18dba059357721b272a Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 21 Jun 2015 21:42:58 +0100 Subject: Added PGP logging preferences --- src/command/commands.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/command/commands.c') diff --git a/src/command/commands.c b/src/command/commands.c index 03a3f9f6..38f15a74 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -4145,6 +4145,29 @@ cmd_pgp(ProfWin *window, gchar **args, struct cmd_help_t help) return TRUE; } + if (g_strcmp0(args[0], "log") == 0) { + char *choice = args[1]; + if (g_strcmp0(choice, "on") == 0) { + prefs_set_string(PREF_PGP_LOG, "on"); + cons_show("PGP messages will be logged as plaintext."); + if (!prefs_get_boolean(PREF_CHLOG)) { + cons_show("Chat logging is currently disabled, use '/chlog on' to enable."); + } + } else if (g_strcmp0(choice, "off") == 0) { + prefs_set_string(PREF_PGP_LOG, "off"); + cons_show("PGP message logging disabled."); + } else if (g_strcmp0(choice, "redact") == 0) { + prefs_set_string(PREF_PGP_LOG, "redact"); + cons_show("PGP messages will be logged as '[redacted]'."); + if (!prefs_get_boolean(PREF_CHLOG)) { + cons_show("Chat logging is currently disabled, use '/chlog on' to enable."); + } + } else { + cons_show("Usage: %s", help.usage); + } + return TRUE; + } + if (g_strcmp0(args[0], "keys") == 0) { GSList *keys = p_gpg_list_keys(); if (!keys) { -- cgit 1.4.1-2-gfad0