about summary refs log tree commit diff stats
path: root/src/command/cmd_funcs.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-03-18 18:20:05 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-03-18 18:20:05 +0100
commit3c56b289ed04f8525affd532d0192d653e1dcd95 (patch)
treeafb0b55eea620a1d8f4968a67756f88a00c3b25d /src/command/cmd_funcs.c
parented97e3730a846dd17d6350cbe6cce25e419f83e4 (diff)
downloadprofani-tty-3c56b289ed04f8525affd532d0192d653e1dcd95.tar.gz
Add slashguard feature
New command `/slashguard` tries to protect against typing ` /quit` by
not allowing a slash in the first 4 characters.
Diffstat (limited to 'src/command/cmd_funcs.c')
-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 1776c72e..cee58c7a 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -8836,3 +8836,15 @@ cmd_correct(ProfWin *window, const char *const command, gchar **args)
     win_println(window, THEME_DEFAULT, "!", "Command /correct only valid in regular chat windows.");
     return TRUE;
 }
+
+gboolean
+cmd_slashguard(ProfWin *window, const char *const command, gchar **args)
+{
+    if (args[0] == NULL) {
+        return FALSE;
+    }
+
+    _cmd_set_boolean_preference(args[0], command, "Slashguard", PREF_SLASH_GUARD);
+
+    return TRUE;
+}