about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-06-21 21:42:58 +0100
committerJames Booth <boothj5@gmail.com>2015-06-21 21:42:58 +0100
commit3d2f999efb9995e003f0d18dba059357721b272a (patch)
tree6ee40c60c550eead99a51de119c5d9e8f579b6b4 /src/command/commands.c
parent446027b9505342c09f62f6d7a279c65a0d1db107 (diff)
downloadprofani-tty-3d2f999efb9995e003f0d18dba059357721b272a.tar.gz
Added PGP logging preferences
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c23
1 files changed, 23 insertions, 0 deletions
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) {