From 5d90199a41dc53259f5bacd42d59155d09a1a116 Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Wed, 13 Mar 2019 19:50:43 +0140 Subject: [PATCH] Avoid opening win if crypto materials are missing --- src/command/cmd_funcs.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 07c8d3f1..01690867 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -7915,6 +7915,11 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args) return TRUE; } + if (!omemo_loaded()) { + win_println(window, THEME_DEFAULT, '!', "You have not generated or loaded a cryptographic materials, use '/omemo gen'"); + return TRUE; + } + // recipient supplied if (args[1]) { char *contact = args[1]; @@ -7944,11 +7949,6 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args) return TRUE; } - if (!omemo_loaded()) { - win_println(window, THEME_DEFAULT, '!', "You have not generated or loaded a cryptographic materials, use '/omemo gen'"); - return TRUE; - } - omemo_start_session(barejid); chatwin->is_omemo = TRUE; } else { @@ -7974,11 +7974,6 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args) return TRUE; } - if (!omemo_loaded()) { - win_println(window, THEME_DEFAULT, '!', "You have not generated or loaded a cryptographic materials, use '/omemo gen'"); - return TRUE; - } - omemo_start_session(chatwin->barejid); chatwin->is_omemo = TRUE; }