summary refs log tree commit diff
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
parentApply word wrapping to tabs before setting align (diff)
downloadcatgirl-2a33ee68dd6dc201eb37828f109f02371daa1e80.tar.gz
catgirl-2a33ee68dd6dc201eb37828f109f02371daa1e80.zip
Format WHOIS signon date with %F %T
-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 : "")
 	);
 }
 
;follow=1'>Populate tab-complete listJune McEnroe 2018-08-07Fix /me formatting side-effectsJune McEnroe 2018-08-07Define ui.c BUF_LEN with enumJune McEnroe 2018-08-07Hack clang into checking uiFmt format stringsJune McEnroe 2018-08-07Handle PART and QUIT without messagesJune McEnroe 2018-08-07Make safe filling the who bufferJune McEnroe 2018-08-07Add reverse and reset IRC formatting codesJune McEnroe 2018-08-06Rewrite line editing again, add formattingJune McEnroe 2018-08-06Fix allocation size in vaswprintfJune McEnroe 2018-08-06Implement word wrappingJune McEnroe 2018-08-06Use wchar_t strings for all of UIJune McEnroe 2018-08-06Rename line editing functionsJune McEnroe 2018-08-05Initialize all possible color pairsJune McEnroe 2018-08-05Refactor color initializationJune McEnroe 2018-08-05Add ^L redrawJune McEnroe 2018-08-05Use 16 colors if availableJune McEnroe 2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe 2018-08-04Show source link on exitJune McEnroe 2018-08-04Implement line editing, scrollingJune McEnroe 2018-08-04Handle /topicJune McEnroe