1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Avoid opening win if crypto materials are missing

This commit is contained in:
Paul Fariello 2019-03-13 19:50:43 +01:40
parent 89ece4f235
commit 5d90199a41

View File

@ -7915,6 +7915,11 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args)
return TRUE; 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 // recipient supplied
if (args[1]) { if (args[1]) {
char *contact = args[1]; char *contact = args[1];
@ -7944,11 +7949,6 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args)
return TRUE; 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); omemo_start_session(barejid);
chatwin->is_omemo = TRUE; chatwin->is_omemo = TRUE;
} else { } else {
@ -7974,11 +7974,6 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args)
return TRUE; 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); omemo_start_session(chatwin->barejid);
chatwin->is_omemo = TRUE; chatwin->is_omemo = TRUE;
} }