From 6a5ebb0babde3afab973c1aebe3c4bfb33101d62 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 11 Feb 2020 18:15:25 -0500 Subject: [PATCH] Don't insert color codes for non-mentions --- handle.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/handle.c b/handle.c index 40d3f28..48d4344 100644 --- a/handle.c +++ b/handle.c @@ -554,7 +554,12 @@ static const char *colorMentions(size_t id, struct Message *msg) { size_t len = strcspn(mention, ",<> "); char punct = mention[len]; mention[len] = '\0'; - fprintf(str, "\3%02d%s\3", completeColor(id, mention), mention); + enum Color color = completeColor(id, mention); + if (color != Default) { + fprintf(str, "\3%02d%s\3", color, mention); + } else { + fprintf(str, "%s", mention); + } mention[len] = punct; mention += len; }