summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-11 18:15:25 -0500
committerJune McEnroe <june@causal.agency>2020-02-11 18:15:25 -0500
commit6a5ebb0babde3afab973c1aebe3c4bfb33101d62 (patch)
tree4197f234acf1b8fee02d04baa5d227c93f9dbc1b
parentTake first two words in colorMentions (diff)
downloadcatgirl-6a5ebb0babde3afab973c1aebe3c4bfb33101d62.tar.gz
catgirl-6a5ebb0babde3afab973c1aebe3c4bfb33101d62.zip
Don't insert color codes for non-mentions
-rw-r--r--handle.c7
1 files changed, 6 insertions, 1 deletions
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;
 	}
00'>2020-02-11Set self.nick to * initiallyJune McEnroe 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe