about summary refs log tree commit diff stats
path: root/src/command/cmd_defs.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-03-25 12:54:25 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-03-25 12:54:25 +0100
commit4fc938d80425f647a7db34ff2f23b05780552d49 (patch)
treefdc4574dcb5af58565834c770449f5cb254c4baa /src/command/cmd_defs.c
parent4f19ea264218fc93f4bca00b1f5a901c0ddc1b44 (diff)
downloadprofani-tty-4fc938d80425f647a7db34ff2f23b05780552d49.tar.gz
Add setting to not colorize own nick according to xep-0392
Some users might want there nick to always stay white (etc) for easier
recognition.

Now we can do `/color own off` to not generate the color based on
xep-0392. The `me=` color (etc) from the theme will then be used.

Once we run this command `theme_load()` is called again.
And the theme looks totally wrong.
We encountered this at other times already and I think it's nothing
wrong with this new code here now but that there seems to be a missing
closing attr for the color when drawing.

Should be investigated seperately.

Fix https://github.com/profanity-im/profanity/issues/1288
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r--src/command/cmd_defs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index 21e8f6f5..06904bbf 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2322,22 +2322,25 @@ static struct cmd_t command_defs[] =
     },
 
     { "/color",
-        parse_args, 1, 1, &cons_color_setting,
+        parse_args, 1, 2, &cons_color_setting,
         CMD_NOSUBFUNCS
         CMD_MAINFUNC(cmd_color)
         CMD_TAGS(
             CMD_TAG_UI)
         CMD_SYN(
-            "/color on|off|redgreen|blue")
+            "/color on|off|redgreen|blue",
+            "/color own on|off")
         CMD_DESC(
             "Settings for consistent color generation for nicks (XEP-0392). Including corrections for Color Vision Deficiencies. "
             "Your terminal needs to support 256 colors.")
         CMD_ARGS(
-            { "on|off|redgreen|blue", "Enable or disable nick colorization for MUC nicks. 'redgreen' is for people with red/green blindess and 'blue' for people with blue blindness."})
+            { "on|off|redgreen|blue", "Enable or disable nick colorization for MUC nicks. 'redgreen' is for people with red/green blindess and 'blue' for people with blue blindness."},
+            { "own on|off", "Enable color generation for own nick. If disabled the color from the color from the theme ('me') will get used."})
         CMD_EXAMPLES(
             "/color off",
             "/color on",
-            "/color blue")
+            "/color blue",
+            "/color own off")
     },
 
     { "/avatar",