From e307f3080ae16477831c6fb4a4d5ece8d46b4ba9 Mon Sep 17 00:00:00 2001
From: Eric Oulashin <nightfox@synchro.net>
Date: Wed, 16 Apr 2025 00:40:35 +0000
Subject: [PATCH] DDMsgReader: For the sysop reading personal email addressed
 to 'sysop', mark the email read

---
 xtrn/DDMsgReader/DDMsgReader.js       | 16 ++++++------
 xtrn/DDMsgReader/ddmr_cfg.js          |  4 +--
 xtrn/DDMsgReader/readme.txt           | 36 +++++++++++++--------------
 xtrn/DDMsgReader/revision_history.txt |  2 ++
 4 files changed, 31 insertions(+), 27 deletions(-)

diff --git a/xtrn/DDMsgReader/DDMsgReader.js b/xtrn/DDMsgReader/DDMsgReader.js
index c257ea4e65..296e8d92b9 100644
--- a/xtrn/DDMsgReader/DDMsgReader.js
+++ b/xtrn/DDMsgReader/DDMsgReader.js
@@ -240,6 +240,9 @@
  *                              Synchronet fix related to @-code parsing (Git commit
  *                              fccf1a5718fdcb9864bcbccf2eb6de7ee50d3dd3). Hopefully the
  *                              mouse clicks are still correct.
+ * 2025-04-15 Eric Oulashin     Version 1.96o
+ *                              Fix: For the sysop reading personal email addressed to
+ *                              "sysop", mark the email as read
  */
 
 "use strict";
@@ -347,8 +350,8 @@ var hexdump = load('hexdump_lib.js');
 
 
 // Reader version information
-var READER_VERSION = "1.96N";
-var READER_DATE = "2025-04-13";
+var READER_VERSION = "1.96o";
+var READER_DATE = "2025-04-15";
 
 // Keyboard key codes for displaying on the screen
 var UP_ARROW = ascii(24);
@@ -5620,8 +5623,10 @@ function DigDistMsgReader_ReadMessageEnhanced(pOffset, pAllowChgArea)
 	if (retObj.msgNotReadable)
 		return retObj;
 
-	// Mark the message as read if it was written to the current user
-	if (userHandleAliasNameMatch(msgHeader.to))
+	// Mark the message as read if it was written to the current user.
+	// For personal email, the message header should have a "to_ext"
+	// that will match the current user number if the email is to them
+	if (userHandleAliasNameMatch(msgHeader.to) || (msgHeader.hasOwnProperty("to_ext") && msgHeader.to_ext == user.number))
 	{
 		// Using applyAttrsInMsgHdrInMessagbase(), which loads the header without
 		// expanded fields and saves the attributes with that header.
@@ -5629,9 +5634,6 @@ function DigDistMsgReader_ReadMessageEnhanced(pOffset, pAllowChgArea)
 		if (this.SearchTypePopulatesSearchResults() && saveRetObj.saveSucceeded)
 			this.RefreshHdrInSavedArrays(pOffset, MSG_READ, true);
 	}
-	// For personal email, if we wanted to really check that it was written to the current sysop user:
-	//var personalEmailToCurrentSysopUser = this.readingPersonalEmail && user.is_sysop && msgHeader.to.toUpperCase().indexOf("SYSOP") == 0;
-	//if (((msgHeader.attr & MSG_READ) == 0) && (userHandleAliasNameMatch(msgHeader.to) || personalEmailToCurrentSysopUser))
 
 	// Updating message pointers etc.
 	updateScanPtrAndOrLastRead(this.subBoardCode, msgHeader, this.doingMsgScan);
diff --git a/xtrn/DDMsgReader/ddmr_cfg.js b/xtrn/DDMsgReader/ddmr_cfg.js
index e1b97b14c4..0120ab64d7 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.96N.
+// Currently for DDMsgReader 1.96o.
 //
 // 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.96N Configurator"))
+if (!uifc.init("DigDist. Message Reader 1.96o Configurator"))
 {
 	print("Failed to initialize uifc");
 	exit(1);
diff --git a/xtrn/DDMsgReader/readme.txt b/xtrn/DDMsgReader/readme.txt
index c0b53a4a25..08cb70fe0a 100644
--- a/xtrn/DDMsgReader/readme.txt
+++ b/xtrn/DDMsgReader/readme.txt
@@ -1,6 +1,6 @@
                       Digital Distortion Message Reader
-                                 Version 1.96N
-                           Release date: 2025-04-13
+                                 Version 1.96o
+                           Release date: 2025-04-15
 
                                      by
 
@@ -1322,7 +1322,7 @@ This is an example of the sub-board menu that appears in indexed mode - And from
 here, the user can choose a sub-board to read:
 
 Description                                                 Total New Last Post
-───── AgoraNet ────────────────────────────────────────────────────────────────
+��������������� AgoraNet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
     AGN GEN - General Chat                                   1004  0 2023-04-02
     AGN BBS - BBS Discussion                                 1000  0 2023-01-17
 NEW AGN ART - Art/Demo Scene                                  603  1 2023-04-02
@@ -1331,7 +1331,7 @@ NEW AGN ART - Art/Demo Scene                                  603  1 2023-04-02
     AGN L46 - League Scores & Recons                         1000  0 2016-09-10
 NEW AGN TST - Testing Setups                                 2086 10 2023-04-03
     AGN SYS - Sysops Only                                    1000  0 2023-01-19
-───── FIDO - FidoNet ──────────────────────────────────────────────────────────
+��������������� FIDO - FidoNet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
 NEW BBS CARNIVAL - BBS Software Chatter                       660  5 2023-04-04
     BBS INTERNET - DOS/Win/OS2/Unix Internet BBS Applicatio    18  0 2023-03-04
     CHWARE - Cheepware Support/Discussion                     111  0 2023-03-16
@@ -1364,20 +1364,20 @@ added for a user will be preserved (DDMsgReader does a bitwise 'or').
 
 A quick-validation set in SCFG is a set that includes a security level, flag
 sets, exemptions, restrictions, and additional credits. For example:
-╔[■][?]═══════════════════╗
-║ Quick-Validation Values ║
-╠═════════════════════════╣
-║ │0  SL: 5   F1:         ║
-║ │1  SL: 10  F1:         ║
-║ │2  SL: 20  F1:         ║
-║ │3  SL: 30  F1:         ║
-║ │4  SL: 40  F1:         ║
-║ │5  SL: 50  F1:         ║
-║ │6  SL: 60  F1:         ║
-║ │7  SL: 70  F1:         ║
-║ │8  SL: 80  F1:         ║
-║ │9  SL: 90  F1:         ║
-╚═════════════════════════╝
+���[���][?]������������������������������������������������������������
+��� Quick-Validation Values ���
+���������������������������������������������������������������������������������
+��� ���0  SL: 5   F1:         ���
+��� ���1  SL: 10  F1:         ���
+��� ���2  SL: 20  F1:         ���
+��� ���3  SL: 30  F1:         ���
+��� ���4  SL: 40  F1:         ���
+��� ���5  SL: 50  F1:         ���
+��� ���6  SL: 60  F1:         ���
+��� ���7  SL: 70  F1:         ���
+��� ���8  SL: 80  F1:         ���
+��� ���9  SL: 90  F1:         ���
+���������������������������������������������������������������������������������
 
 
 
diff --git a/xtrn/DDMsgReader/revision_history.txt b/xtrn/DDMsgReader/revision_history.txt
index faa190ef9e..3456413b7e 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.96o    2025-04-15   Fix: For the sysop reading personal email addressed to
+                      "sysop", mark the email as read
 1.96N    2025-04-13   Changes (fixes) for the bottom-row key help lines due to
                       Synchronet fix related to @-code parsing (Git commit
                       fccf1a5718fdcb9864bcbccf2eb6de7ee50d3dd3). Hopefully the
-- 
GitLab