summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-06 22:59:49 -0500
committerJune McEnroe <june@causal.agency>2020-02-06 22:59:49 -0500
commit87e42cc62768435dea48a86a60729cd5696f67f1 (patch)
tree4cef361d619edd1cb3b938dd0335f1c3d0078ac7
parentShow input in italics for actions and set Debug prompt (diff)
downloadcatgirl-87e42cc62768435dea48a86a60729cd5696f67f1.tar.gz
catgirl-87e42cc62768435dea48a86a60729cd5696f67f1.zip
Color notices LightGray by default
Diffstat (limited to '')
-rw-r--r--handle.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/handle.c b/handle.c
index ab482fd..fb49206 100644
--- a/handle.c
+++ b/handle.c
@@ -294,18 +294,26 @@ static void handlePrivmsg(struct Message *msg) {
 	bool notice = (msg->cmd[0] == 'N');
 	bool action = isAction(msg);
 	bool mention = !mine && isMention(msg);
-	const char *italic = (action ? "\35" : "");
-	const char *reverse = (mention ? "\26" : "");
-	uiFormat(
-		id, (!notice && (mention || query) ? Hot : Warm), tagTime(msg),
-		"%s%s\3%d%s%s%s\3%s\t%s",
-		italic, reverse, hash(msg->user),
-		(action ? "* " : notice ? "-" : "<"),
-		msg->nick,
-		(action ? "" : notice ? "-" : ">"),
-		reverse,
-		msg->params[1]
-	);
+	if (notice) {
+		uiFormat(
+			id, Warm, tagTime(msg),
+			"%s\3%d-%s-\17\3%d\t%s",
+			(mention ? "\26" : ""), hash(msg->user), msg->nick,
+			LightGray, msg->params[1]
+		);
+	} else if (action) {
+		uiFormat(
+			id, (mention || query ? Hot : Warm), tagTime(msg),
+			"%s\35\3%d* %s\17\35\t%s",
+			(mention ? "\26" : ""), hash(msg->user), msg->nick, msg->params[1]
+		);
+	} else {
+		uiFormat(
+			id, (mention || query ? Hot : Warm), tagTime(msg),
+			"%s\3%d<%s>\17\t%s",
+			(mention ? "\26" : ""), hash(msg->user), msg->nick, msg->params[1]
+		);
+	}
 }
 
 static void handlePing(struct Message *msg) {
n <b>, <i>, <u>June McEnroe 2019-07-11Factor out clearJune McEnroe 2019-07-11Add bright option to shottyJune McEnroe 2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe 2019-07-10Ignore SM and RMJune McEnroe 2019-07-09Add shotty man page and build itJune McEnroe 2019-07-09Add up -cJune McEnroe 2019-07-09Add options for default colors to shottyJune McEnroe 2019-07-08Use char literals consistentlyJune McEnroe