From a07880f5c0513aeedb88422c422b8c7fb8bf4611 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 13 Jan 2014 19:16:46 +0000 Subject: [PATCH] Implemented /otr start --- src/command/commands.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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();