From 984c371ae383e19fcdb99cae416b85e8b4761390 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Fri, 6 Sep 2024 20:48:08 -0700
Subject: [PATCH] Don't use QWK reply message date unless time zone is also
 specified

For regular user QWK Relpy packet uploads only, if no timezone is specified
(e.g. via @TZ kludge or HEADERS.DAT), then over-ride the message's "posted"
date/time with the current date/time since we're going to set the message's
timezone to the BBS's local timezone as well.

This is a fix for issue #783 reported by Chris Jacobs.

If/when we support user-specified timezones, then this likely would be a
place where we'd want to use the user's timezone.
---
 src/sbbs3/qwktomsg.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/qwktomsg.cpp b/src/sbbs3/qwktomsg.cpp
index dbe7035700..7354362fdb 100644
--- a/src/sbbs3/qwktomsg.cpp
+++ b/src/sbbs3/qwktomsg.cpp
@@ -259,12 +259,12 @@ bool sbbs_t::qwk_import_msg(FILE *qwk_fp, char *hdrblk, uint blocks
 		&& sub_op(subnum))
 		msg->hdr.attr|=MSG_PERMANENT;
 
-	if(!(useron.rest&FLAG('Q')) && !fromhub && msg->hdr.when_written.zone==0)
-		msg->hdr.when_written.zone=sys_timezone(&cfg);
-
 	msg->hdr.when_imported.time=time32(NULL);
 	msg->hdr.when_imported.zone=sys_timezone(&cfg);
 
+	if(!(useron.rest&FLAG('Q')) && !fromhub && msg->hdr.when_written.zone==0)
+		msg->hdr.when_written = msg->hdr.when_imported;
+
 	hdrblk[116]=0;	// don't include number of blocks in "re: msg number"
 	if(!(useron.rest&FLAG('Q')) && !fromhub)
 		msg->hdr.thread_back=atol((char *)hdrblk+108);
-- 
GitLab