about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-13 19:16:46 +0000
committerJames Booth <boothj5@gmail.com>2014-01-13 19:16:46 +0000
commita07880f5c0513aeedb88422c422b8c7fb8bf4611 (patch)
tree79369d9439030aec3c848a3168bf2562a687102a /src/command
parentbc1d4df2303f31f0bd97aa2c15e4494e17291963 (diff)
downloadprofani-tty-a07880f5c0513aeedb88422c422b8c7fb8bf4611.tar.gz
Implemented /otr start <contact>
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 75c478b0..170c519c 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2345,6 +2345,17 @@ cmd_otr(gchar **args, struct cmd_help_t help)
             }
 
             ui_new_chat_win(barejid);
+
+            if (ui_current_win_is_otr()) {
+                ui_current_print_line("You are already in an OTR session.");
+            } else {
+                if (!otr_key_loaded()) {
+                    ui_current_print_line("You have not generated or loaded a private key, use '/otr gen'");
+                } else {
+                    char *recipient = ui_current_recipient();
+                    message_send("?OTR?", recipient);
+                }
+            }
         } else {
             win_type_t win_type = ui_current_win_type();