about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-08 00:42:27 -0400
committerJune McEnroe <june@causal.agency>2018-08-08 00:42:27 -0400
commitc0ee457ab146326a961008e518b7ffbc581ec744 (patch)
tree9348f18b710229eb43821fbef03e28f46b7cbd5a
parentUse BLACK LEFT-POINTING TRIANGLE for marker (diff)
downloadcatgirl-c0ee457ab146326a961008e518b7ffbc581ec744.tar.gz
catgirl-c0ee457ab146326a961008e518b7ffbc581ec744.zip
Color own messages 15
My own settings have "white" slightly darker than the default color, so
this helps to distinguish my own messages.
-rw-r--r--handle.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/handle.c b/handle.c
index e2169e5..88c17b7 100644
--- a/handle.c
+++ b/handle.c
@@ -222,16 +222,20 @@ static void handlePrivmsg(char *prefix, char *params) {
 	shift(&params);
 	char *mesg = shift(&params);
 	tabTouch(nick);
+	bool self = !strcmp(user, chat.user);
+	bool ping = !strncasecmp(mesg, chat.nick, strlen(chat.nick));
+	if (ping) uiBeep();
 	if (mesg[0] == '\1') {
 		strsep(&mesg, " ");
 		char *action = strsep(&mesg, "\1");
-		uiFmt("* \3%d%s\3 %s", color(user), nick, action);
+		uiFmt(
+			"* \3%d%s\3%s %s",
+			color(user), nick, (self ? "15" : ""), action
+		);
 	} else {
-		bool ping = !strncasecmp(mesg, chat.nick, strlen(chat.nick));
-		if (ping) uiBeep();
 		uiFmt(
-			"<%s\3%d%s\17> %s",
-			(ping ? "\26" : ""), color(user), nick, mesg
+			"<%s\3%d%s\17>\3%s %s",
+			(ping ? "\26" : ""), color(user), nick, (self ? "15" : ""), mesg
 		);
 	}
 }