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-02-20 08:11:58 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-02-20 08:11:58 +0100
commit80dd3fdbb2ee8c453f5828d8cacb029d222d3779 (patch)
tree9e15b43097a1da577035f2df477feeb32b211e34 /src/command/cmd_funcs.c
parent6aa793fca6c3ec74e04d28ce209dd460252e1079 (diff)
downloadprofani-tty-80dd3fdbb2ee8c453f5828d8cacb029d222d3779.tar.gz
Add option to color MUC history like regular messages
`/logging group color` has:
* `unanimous` which will color it with one unanimous color. Like it was
done always.
* `regular` which colors it like regular incoming messages.

Regards https://github.com/profanity-im/profanity/issues/1261
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r--src/command/cmd_funcs.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 4f617ffe..c65bf10a 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -6721,12 +6721,22 @@ cmd_logging(ProfWin *window, const char *const command, gchar **args)
         if (strcmp(args[1], "off") == 0) {
             prefs_set_boolean(PREF_HISTORY, FALSE);
         }
-    } else if (strcmp(args[0], "group") == 0) {
-        _cmd_set_boolean_preference(args[1], command, "Groupchat logging", PREF_GRLOG);
-    } else {
-        cons_bad_cmd_usage(command);
+
+        return TRUE;
+    } else if (g_strcmp0(args[0], "group") == 0) {
+        if (g_strcmp0(args[1], "on") == 0 || g_strcmp0(args[1], "off") == 0) {
+            _cmd_set_boolean_preference(args[1], command, "Groupchat logging", PREF_GRLOG);
+            return TRUE;
+        } else if (strcmp(args[1], "color") == 0 && args[2] != NULL) {
+            if (g_strcmp0(args[2], "unanimous") == 0 || g_strcmp0(args[2], "regular") == 0) {
+                prefs_set_string(PREF_HISTORY_COLOR_MUC, args[2]);
+                cons_show("Groupchat logging color set to: %s", args[2]);
+                return TRUE;
+            }
+        }
     }
 
+    cons_bad_cmd_usage(command);
     return TRUE;
 }