diff options
author | Michael Vetter <jubalh@iodoru.org> | 2022-05-04 00:01:49 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2022-05-04 00:03:45 +0200 |
commit | acedd42d7864fd9e7dd4363cd7f354d4ccede40b (patch) | |
tree | b8b56f6050638a2437dc5a4fd7d7fb7d530bec76 | |
parent | 58911926dee01601887d999dd03be2ae302c8265 (diff) | |
download | profani-tty-acedd42d7864fd9e7dd4363cd7f354d4ccede40b.tar.gz |
ox: print message when `/ox end` is run but not started
-rw-r--r-- | src/command/cmd_funcs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 040e1478..f1fa37f1 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -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]) { |