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:
parent
58911926de
commit
acedd42d78
@ -7650,7 +7650,7 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatwin->is_ox) {
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7673,15 +7673,19 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
} else if (g_strcmp0(args[0], "end") == 0) {
|
} else if (g_strcmp0(args[0], "end") == 0) {
|
||||||
if (window->type != WIN_CHAT && args[1] == NULL) {
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfChatWin* chatwin = (ProfChatWin*)window;
|
ProfChatWin* chatwin = (ProfChatWin*)window;
|
||||||
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
||||||
|
|
||||||
chatwin->is_ox = FALSE;
|
if (!chatwin->is_ox) {
|
||||||
win_println(window, THEME_DEFAULT, "!", "OX encryption disabled.");
|
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;
|
return TRUE;
|
||||||
} else if (g_strcmp0(args[0], "announce") == 0) {
|
} else if (g_strcmp0(args[0], "announce") == 0) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user