From 34514cf2ee6dd020ca812653ce3a23e737d2bf62 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 6 Feb 2020 18:48:49 -0500 Subject: 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. --- handle.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'handle.c') 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] ); } -- cgit 1.4.1