about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-02-14 11:15:32 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-02-14 11:18:16 +0100
commitedba5c83ff0238ab71174da96c353418d5b11e67 (patch)
tree4d8518464a8a8eaaf1b5a0ff76c7e3bd3336708d
parentc995f3150e8582907c749968e2c0c8b1022a43c1 (diff)
downloadprofani-tty-edba5c83ff0238ab71174da96c353418d5b11e67.tar.gz
xep-0308: only allow /correct when corrections are enabled
-rw-r--r--src/command/cmd_funcs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 40f5d8f4..93b002f4 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -8691,6 +8691,11 @@ cmd_correct(ProfWin *window, const char *const command, gchar **args)
         return TRUE;
     }
 
+    if (!prefs_get_boolean(PREF_CORRECTION_ALLOW)) {
+        win_println(window, THEME_DEFAULT, '!', "Corrections not enabled. See /help correction.");
+        return TRUE;
+    }
+
     if (window->type == WIN_CHAT) {
         ProfChatWin *chatwin = (ProfChatWin*)window;
         assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);