summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-02 18:55:35 -0500
committerJune McEnroe <june@causal.agency>2020-03-02 18:55:35 -0500
commit34daf56d67522d13375b1dca80d313955b85e7c2 (patch)
tree5be656896c7fda0f15820411128ed83b85b1f0e7
parentReplace .mk files with configure script (diff)
downloadlitterbox-34daf56d67522d13375b1dca80d313955b85e7c2.tar.gz
litterbox-34daf56d67522d13375b1dca80d313955b85e7c2.zip
Include <>/-/* around nicks in scoop coloring 1.1
-rw-r--r--scoop.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/scoop.c b/scoop.c
index a12b37b..7750a47 100644
--- a/scoop.c
+++ b/scoop.c
@@ -146,46 +146,52 @@ static void formatColor(bool group, struct Event e) {
 	}
 	printf("[%s] ", e.time);
 
-#define NICK "\33[%dm%s\33[m"
+#define C "\33[%dm"
+#define O "\33[m"
 	switch (e.type) {
 		break; case Privmsg: {
-			printf("<" NICK "> %s\n", color(e.user), e.nick, ansi(e.message));
+			printf(C "<%s>" O " %s\n", color(e.user), e.nick, ansi(e.message));
 		}
 		break; case Notice: {
-			printf("-" NICK "- %s\n", color(e.user), e.nick, ansi(e.message));
+			printf(C "-%s-" O " %s\n", color(e.user), e.nick, ansi(e.message));
 		}
 		break; case Action: {
-			printf("* " NICK " %s\n", color(e.user), e.nick, ansi(e.message));
+			printf(C "* %s" O " %s\n", color(e.user), e.nick, ansi(e.message));
 		}
 		break; case Join: {
-			printf(NICK " joined\n", color(e.user), e.nick);
+			printf(C "%s" O " joined\n", color(e.user), e.nick);
 		}
 		break; case Part: {
-			printf(NICK " parted: %s\n", color(e.user), e.nick, ansi(e.message));
+			printf(
+				C "%s" O " parted: %s\n", color(e.user), e.nick, ansi(e.message)
+			);
 		}
 		break; case Quit: {
-			printf(NICK " quit: %s\n", color(e.user), e.nick, ansi(e.message));
+			printf(
+				C "%s" O " quit: %s\n", color(e.user), e.nick, ansi(e.message)
+			);
 		}
 		break; case Kick: {
 			printf(
-				NICK " kicked %s: %s\n",
+				C "%s" O " kicked %s: %s\n",
 				color(e.user), e.nick, e.target, ansi(e.message)
 			);
 		}
 		break; case Nick: {
 			printf(
-				NICK " changed nick to " NICK "\n",
+				C "%s" O " changed nick to " C "%s" O "\n",
 				color(e.user), e.nick, color(e.user), e.target
 			);
 		}
 		break; case Topic: {
 			printf(
-				NICK "set the topic: %s\n",
+				C "%s" O " set the topic: %s\n",
 				color(e.user), e.nick, ansi(e.message)
 			);
 		}
 	}
-#undef NICK
+#undef C
+#undef O
 }
 
 static void formatIRC(bool group, struct Event e) {