about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2022-05-03 18:54:20 +0200
committerMichael Vetter <jubalh@iodoru.org>2022-05-03 18:54:20 +0200
commite5998fb63ee27eaa9997847387fa05d1149e340b (patch)
tree7fdced1a18c547dfedd7ac51c0365f99c98c51b7
parentc8daee8c88669f6773aaaf11b08f1c9444da1815 (diff)
downloadprofani-tty-e5998fb63ee27eaa9997847387fa05d1149e340b.tar.gz
ox: implement `/ox end`
We also need to be able to stop an ox conversation :-)
-rw-r--r--src/command/cmd_funcs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index e76831fc..040e1478 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -7671,6 +7671,18 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
         chatwin->is_ox = TRUE;
         win_println(window, THEME_DEFAULT, "!", "OX encryption enabled.");
         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.");
+            return TRUE;
+        }
+
+        ProfChatWin* chatwin = (ProfChatWin*)window;
+        assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
+
+        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]) {
             gchar* filename = get_expanded_path(args[1]);