about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-06-18 01:34:27 +0100
committerJames Booth <boothj5@gmail.com>2015-06-18 01:34:27 +0100
commitea99012d9bf1b8de356d3d9beb7cc45c3f456bad (patch)
tree78f31a66fcd330a30f5b262b38cb4621f509e52e /src
parent85cc5ab50deaec93f5520f3d587fba57040c2c88 (diff)
downloadprofani-tty-ea99012d9bf1b8de356d3d9beb7cc45c3f456bad.tar.gz
Added initial /pgp start checks
Diffstat (limited to 'src')
-rw-r--r--src/command/commands.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 85a85131..f40723be 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -4172,6 +4172,13 @@ cmd_pgp(ProfWin *window, gchar **args, struct cmd_help_t help)
         } else {
             cons_show("Could not get libgpgme version");
         }
+    } else if (g_strcmp0(args[0], "start") == 0) {
+        jabber_conn_status_t conn_status = jabber_get_connection_status();
+        if (conn_status != JABBER_CONNECTED) {
+            cons_show("You must be connected to start PGP encrpytion.");
+        } else if (window->type != WIN_CHAT && args[1] == NULL) {
+            cons_show("You must be in a regular chat window to start PGP encrpytion.");
+        }
     }
 
     return TRUE;