summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-19 21:29:51 -0500
committerJune McEnroe <june@causal.agency>2020-02-19 21:29:51 -0500
commit2a33ee68dd6dc201eb37828f109f02371daa1e80 (patch)
treee388a3ee69988e5fc5a1bbc22860fe403afbbd57 /handle.c
parentApply word wrapping to tabs before setting align (diff)
downloadcatgirl-2a33ee68dd6dc201eb37828f109f02371daa1e80.tar.gz
catgirl-2a33ee68dd6dc201eb37828f109f02371daa1e80.zip
Format WHOIS signon date with %F %T
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/handle.c b/handle.c
index cec823a..fd8b25f 100644
--- a/handle.c
+++ b/handle.c
@@ -498,14 +498,16 @@ static void handleReplyWhoisIdle(struct Message *msg) {
 			}
 		}
 	}
-	time_t signon = (msg->params[3] ? strtoul(msg->params[3], NULL, 10) : 0);
+	char signon[sizeof("0000-00-00 00:00:00")];
+	time_t time = (msg->params[3] ? strtol(msg->params[3], NULL, 10) : 0);
+	strftime(signon, sizeof(signon), "%F %T", localtime(&time));
 	uiFormat(
 		Network, Warm, tagTime(msg),
-		"\3%02d%s\3\tis idle for %lu %s%s%s%.*s",
+		"\3%02d%s\3\tis idle for %lu %s%s%s%s",
 		completeColor(Network, msg->params[1]), msg->params[1],
 		idle, unit, (idle != 1 ? "s" : ""),
-		(signon ? ", signed on " : ""),
-		24, (signon ? ctime(&signon) : "")
+		(msg->params[3] ? ", signed on " : ""),
+		(msg->params[3] ? signon : "")
 	);
 }
 
f786a0594b24f0cf35750696f8c8c9&follow=1'>Ignore NOTICEs not sent to the channelJune McEnroe 2018-08-03Handle KICK and NICKJune McEnroe 2018-08-03Continue on EINTR from pollJune McEnroe Resizing the terminal causes it. 2018-08-03Handle ACTIONsJune McEnroe 2018-08-03Use more octal char literalsJune McEnroe I might be coming around to octal. 2018-08-03Send a WHO in response to NAMES to get usernamesJune McEnroe Other than this slight hack, I think coloring by username rather than nick is a much better idea. 2018-08-03Colorize nicks and channelsJune McEnroe 2018-08-03Add support for mIRC colorsJune McEnroe 2018-08-03Handle bold, italic, underlineJune McEnroe 2018-08-03Add prift function for "prefix shift"June McEnroe Forgive me. 2018-08-03Link with -lcurseswJune McEnroe 2018-08-02Use libtls "compat" ciphersJune McEnroe irc.mozilla.org, using GnuTLS, doesn't support *any* of the "secure" ciphers! 2018-08-02Add UI and handle some kinds of server messagesJune McEnroe Seems like handling input is going to be the worst thing ever. 2018-08-02Add chroot.tar targetJune McEnroe