1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Added enc_mode check when starting OTR

This commit is contained in:
James Booth 2015-06-21 20:13:28 +01:00
parent 5669799690
commit f81652e84e

View File

@ -4403,6 +4403,11 @@ cmd_otr(ProfWin *window, gchar **args, struct cmd_help_t help)
}
ui_ev_focus_win((ProfWin*)chatwin);
if (chatwin->enc_mode == PROF_ENC_PGP) {
ui_current_print_formatted_line('!', 0, "You must disable PGP encryption before starting an OTR session.");
return TRUE;
}
if (chatwin->enc_mode == PROF_ENC_OTR) {
ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");
return TRUE;
@ -4431,6 +4436,11 @@ cmd_otr(ProfWin *window, gchar **args, struct cmd_help_t help)
ProfChatWin *chatwin = (ProfChatWin*)window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
if (chatwin->enc_mode == PROF_ENC_PGP) {
ui_current_print_formatted_line('!', 0, "You must disable PGP encryption before starting an OTR session.");
return TRUE;
}
if (chatwin->enc_mode == PROF_ENC_OTR) {
ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");
return TRUE;