From f890458d8ce0b2d7f5e660bc29c395c110072a1a Mon Sep 17 00:00:00 2001
From: Eric Oulashin <eric.oulashin@gmail.com>
Date: Fri, 28 Mar 2025 16:44:01 -0700
Subject: [PATCH] DDMsgReader: When reading messages (including sent email),
 only mark it read if it's to the current user. Reported by Accession.

---
 xtrn/DDMsgReader/DDMsgReader.js       | 12 ++++++++----
 xtrn/DDMsgReader/ddmr_cfg.js          |  4 ++--
 xtrn/DDMsgReader/readme.txt           |  4 ++--
 xtrn/DDMsgReader/revision_history.txt |  2 ++
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xtrn/DDMsgReader/DDMsgReader.js b/xtrn/DDMsgReader/DDMsgReader.js
index 0ba269d828..d59e7fec5d 100644
--- a/xtrn/DDMsgReader/DDMsgReader.js
+++ b/xtrn/DDMsgReader/DDMsgReader.js
@@ -231,6 +231,10 @@
  * 2025-02-08 Eric Oulashin     Version 1.96L
  *                              After replying to a message, when it shows the status & pauses
  *                              for input, a Q or Ctrl-C will now exit, and not be ignored.
+ * 2025-05-28 Eric Oulashin     Version 1.96M
+ *                              When reading messages, only mark it as read if it's to
+ *                              the current user, including for personal email (i.e., when reading
+ *                              sent mail, don't mark messages to others as read).
  */
 
 "use strict";
@@ -338,8 +342,8 @@ var hexdump = load('hexdump_lib.js');
 
 
 // Reader version information
-var READER_VERSION = "1.96L";
-var READER_DATE = "2025-02-18";
+var READER_VERSION = "1.96M";
+var READER_DATE = "2025-03-28";
 
 // Keyboard key codes for displaying on the screen
 var UP_ARROW = ascii(24);
@@ -5610,8 +5614,8 @@ function DigDistMsgReader_ReadMessageEnhanced(pOffset, pAllowChgArea)
 	if (retObj.msgNotReadable)
 		return retObj;
 
-	// Mark the message as read if reading personal email or if it was written to the current user
-	if (this.readingPersonalEmail || ((msgHeader.attr & MSG_READ) == 0) && (userHandleAliasNameMatch(msgHeader.to)))
+	// Mark the message as read if it was written to the current user
+	if (userHandleAliasNameMatch(msgHeader.to))
 	{
 		// Using applyAttrsInMsgHdrInMessagbase(), which loads the header without
 		// expanded fields and saves the attributes with that header.
diff --git a/xtrn/DDMsgReader/ddmr_cfg.js b/xtrn/DDMsgReader/ddmr_cfg.js
index df083975f2..43417a6377 100644
--- a/xtrn/DDMsgReader/ddmr_cfg.js
+++ b/xtrn/DDMsgReader/ddmr_cfg.js
@@ -5,7 +5,7 @@
 // If you have DDMsgReader in a directory other than xtrn/DDMsgReader, then the changes to
 // DDMsgReader.cfg will be saved in that directory (assuming you're running ddmr_cfg.js from
 // that same directory).
-// Currently for DDMsgReader 1.96L.
+// Currently for DDMsgReader 1.96M.
 //
 // If you're running DDMsgReader from xtrn/DDMsgReader (the standard location) and you want
 // to save the configuration file there (rather than sbbs/mods), you can use one of the
@@ -18,7 +18,7 @@ require("sbbsdefs.js", "P_NONE");
 require("uifcdefs.js", "UIFC_INMSG");
 
 
-if (!uifc.init("DigDist. Message Reader 1.96L Configurator"))
+if (!uifc.init("DigDist. Message Reader 1.96M Configurator"))
 {
 	print("Failed to initialize uifc");
 	exit(1);
diff --git a/xtrn/DDMsgReader/readme.txt b/xtrn/DDMsgReader/readme.txt
index a87948a78c..62aad447f0 100644
--- a/xtrn/DDMsgReader/readme.txt
+++ b/xtrn/DDMsgReader/readme.txt
@@ -1,6 +1,6 @@
                       Digital Distortion Message Reader
-                                 Version 1.96L
-                           Release date: 2025-02-18
+                                 Version 1.96M
+                           Release date: 2025-03-28
 
                                      by
 
diff --git a/xtrn/DDMsgReader/revision_history.txt b/xtrn/DDMsgReader/revision_history.txt
index ffc280829e..7bb7e1531e 100644
--- a/xtrn/DDMsgReader/revision_history.txt
+++ b/xtrn/DDMsgReader/revision_history.txt
@@ -5,6 +5,8 @@ Revision History (change log)
 =============================
 Version  Date         Description
 -------  ----         -----------
+1.96M    2025-03-28   When reading messages, only mark it as read if it's to the
+                      current user, including when reading sent email.
 1.96L    2025-02-18   After replying to a message, when it shows the status &
                       pauses for input, a Q or Ctrl-C will now exit, and not be
                       ignored.
-- 
GitLab