1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05: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); 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) { if (chatwin->enc_mode == PROF_ENC_OTR) {
ui_current_print_formatted_line('!', 0, "You are already in an OTR session."); ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");
return TRUE; return TRUE;
@ -4431,6 +4436,11 @@ cmd_otr(ProfWin *window, gchar **args, struct cmd_help_t help)
ProfChatWin *chatwin = (ProfChatWin*)window; ProfChatWin *chatwin = (ProfChatWin*)window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); 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) { if (chatwin->enc_mode == PROF_ENC_OTR) {
ui_current_print_formatted_line('!', 0, "You are already in an OTR session."); ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");
return TRUE; return TRUE;