summary refs log tree commit diff
diff options
context:
space:
mode:
-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) {
'>2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe