about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2022-07-04 09:15:03 +0200
committerMichael Vetter <jubalh@iodoru.org>2022-07-04 09:15:03 +0200
commit9ef3491228f67403bfc56a756f6a96aa428df610 (patch)
treeff5417bc89c71a80f9bd834faf2521118ad35209
parent4818b0239102c31e8b6cb34b0351dd1ef0382557 (diff)
downloadprofani-tty-9ef3491228f67403bfc56a756f6a96aa428df610.tar.gz
Let slashguard ignore quoted messages
This let's us whole `/me` messages and other messages starting with `>`.

Fix https://github.com/profanity-im/profanity/issues/1732
-rw-r--r--src/ui/inputwin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index caab9ff1..e59be8b5 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -200,7 +200,8 @@ inp_readline(void)
 
     if (inp_line) {
         if (!get_password && prefs_get_boolean(PREF_SLASH_GUARD)) {
-            if (strlen(inp_line) > 1) {
+            // ignore quoted messages
+            if (strlen(inp_line) > 1 && inp_line[0] != '>') {
                 char* res = (char*)memchr(inp_line + 1, '/', 3);
                 if (res) {
                     cons_show("Your text contains a slash in the first 4 characters");