1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

ox: print message when /ox end is run but not started

This commit is contained in:
Michael Vetter 2022-05-04 00:01:49 +02:00
parent 58911926de
commit acedd42d78

View File

@ -7650,7 +7650,7 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
}
if (chatwin->is_ox) {
win_println(window, THEME_DEFAULT, "!", "You have already started OX encryption.");
win_println(window, THEME_DEFAULT, "!", "You have already started an OX encrypted session.");
return TRUE;
}
@ -7673,15 +7673,19 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
return TRUE;
} else if (g_strcmp0(args[0], "end") == 0) {
if (window->type != WIN_CHAT && args[1] == NULL) {
cons_show("You must be in a regular chat window to stop OX encrpytion.");
cons_show("You must be in a regular chat window to stop OX encryption.");
return TRUE;
}
ProfChatWin* chatwin = (ProfChatWin*)window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
chatwin->is_ox = FALSE;
win_println(window, THEME_DEFAULT, "!", "OX encryption disabled.");
if (!chatwin->is_ox) {
win_println(window, THEME_DEFAULT, "!", "No OX session has been started.");
} else {
chatwin->is_ox = FALSE;
win_println(window, THEME_DEFAULT, "!", "OX encryption disabled.");
}
return TRUE;
} else if (g_strcmp0(args[0], "announce") == 0) {
if (args[1]) {