about summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-06 18:48:49 -0500
committerJune McEnroe <june@causal.agency>2020-02-06 18:48:49 -0500
commit34514cf2ee6dd020ca812653ce3a23e737d2bf62 (patch)
tree8f70074561aee846bb64807334ad30fe22488a9d /handle.c
parentNever consider notices hot (diff)
downloadcatgirl-34514cf2ee6dd020ca812653ce3a23e737d2bf62.tar.gz
catgirl-34514cf2ee6dd020ca812653ce3a23e737d2bf62.zip
Render actions in italic
Also render italic as normal if it's unsupported, as that is what would
happen anyway if curses has A_ITALIC but the terminal has no sitm. That
format string is kinda bad.
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/handle.c b/handle.c
index 49011f5..ab482fd 100644
--- a/handle.c
+++ b/handle.c
@@ -294,14 +294,16 @@ 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\3%d%s%s%s\17\t%s",
-		(mention ? "\26" : ""),
-		hash(msg->user),
+		"%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]
 	);
 }
cc316&follow=1'>Remove TOURJune McEnroe 2022-07-03Add The Bone Shard EmperorJune McEnroe 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe