summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/client.c b/client.c
index b81732d..9b55fdd 100644
--- a/client.c
+++ b/client.c
@@ -485,6 +485,16 @@ static Filter *Filters[] = {
 	[CapUserhostInNamesBit] = filterUserhostInNames,
 };
 
+static bool hasTime(const char *line) {
+	if (!strncmp(line, "@time=", 6)) return true;
+	while (*line && *line != ' ') {
+		line += strcspn(line, "; ");
+		if (!strncmp(line, ";time=", 6)) return true;
+		if (*line == ';') line++;
+	}
+	return false;
+}
+
 void clientConsume(struct Client *client) {
 	struct timeval time;
 	const char *line = ringPeek(&time, client->consumer);
@@ -503,7 +513,7 @@ void clientConsume(struct Client *client) {
 		return;
 	}
 
-	if (client->caps & CapServerTime && !(stateCaps & CapServerTime)) {
+	if (client->caps & CapServerTime && !hasTime(line)) {
 		char ts[sizeof("YYYY-MM-DDThh:mm:ss")];
 		struct tm *tm = gmtime(&time.tv_sec);
 		strftime(ts, sizeof(ts), "%FT%T", tm);
file.am?h=3.3.4&id=3b4a10a68682f3b8590450c9be75a8ed4c7307c4&follow=1'>Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe