From 1c749ca2b13fe081919f12db4ba28ecc42f12ce5 Mon Sep 17 00:00:00 2001 From: Eric Oulashin <eric.oulashin@gmail.com> Date: Fri, 23 Sep 2022 13:07:13 -0700 Subject: [PATCH] DDMsgReader v1.55: Refactored how email replies are done (passing the header to the appropriate functions, not using ungetstr() when prompting for the message subject) --- xtrn/DDMsgReader/DDMsgReader.js | 27 +++++++++++++++++---------- xtrn/DDMsgReader/readme.txt | 4 ++-- xtrn/DDMsgReader/revision_history.txt | 3 +++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/xtrn/DDMsgReader/DDMsgReader.js b/xtrn/DDMsgReader/DDMsgReader.js index 69386fe2d8..c8746ad752 100644 --- a/xtrn/DDMsgReader/DDMsgReader.js +++ b/xtrn/DDMsgReader/DDMsgReader.js @@ -53,6 +53,9 @@ * honors the system setting for whether users can view deleted messages. * 2022-08-06 Eric Oulashin Version 1.54 * Users now have a personal twit list (configurable via Ctrl-U, user settings). + * 2022-09-23 Eric Oulashin Version 1.55 + * Refactored how email replies are done (passing the header to the appropriate + * functions, not using ungetstr() when prompting for the message subject) */ "use strict"; @@ -157,8 +160,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a'); // Reader version information -var READER_VERSION = "1.54"; -var READER_DATE = "2022-08-06"; +var READER_VERSION = "1.55"; +var READER_DATE = "2022-09-23"; // Keyboard key codes for displaying on the screen var UP_ARROW = ascii(24); @@ -9891,19 +9894,22 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode) // message header. Otherwise (i.e., on a networked sub-board), use // username@from_net_addr. var emailAddr = ""; - if (pMsgHdr.from_net_type == NET_INTERNET) - emailAddr = pMsgHdr.from_net_addr; - else - emailAddr = pMsgHdr.from + "@" + pMsgHdr.from_net_addr; + if (typeof(pMsgHdr.from_net_addr) === "string" && pMsgHdr.from_net_addr.length > 0) + { + if (pMsgHdr.from_net_type == NET_INTERNET) + emailAddr = pMsgHdr.from_net_addr; + else + emailAddr = pMsgHdr.from + "@" + pMsgHdr.from_net_addr; + } // Prompt the user to verify the receiver's email address console.putmsg(bbs.text(Email), P_SAVEATR); - console.ungetstr(emailAddr); + if (emailAddr.length > 0) + console.ungetstr(emailAddr); emailAddr = console.getstr(60, K_LINE); if ((typeof(emailAddr) == "string") && (emailAddr.length > 0)) { replyMode |= WM_NETMAIL; - console.ungetstr(pMsgHdr.subject); - retObj.sendSucceeded = bbs.netmail(emailAddr, replyMode); + retObj.sendSucceeded = bbs.netmail(emailAddr, replyMode, null, pMsgHdr); console.pause(); } else @@ -9916,6 +9922,7 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode) } if (replyLocally) { + //console.print("\x01n\r\nHere!\x01p"); // Temporary // Replying to a local user replyMode |= WM_EMAIL; // Look up the user number of the "from" user name in the message header @@ -9927,7 +9934,7 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode) // sender. Note that if the send failed, that could be because the // user aborted the message. console.crlf(); - retObj.sendSucceeded = bbs.email(userNumber, replyMode, "", pMsgHdr.subject); + retObj.sendSucceeded = bbs.email(userNumber, replyMode, null, null, pMsgHdr); console.pause(); } else diff --git a/xtrn/DDMsgReader/readme.txt b/xtrn/DDMsgReader/readme.txt index 82ba8ee507..1fc31cc953 100644 --- a/xtrn/DDMsgReader/readme.txt +++ b/xtrn/DDMsgReader/readme.txt @@ -1,6 +1,6 @@ Digital Distortion Message Reader - Version 1.54 - Release date: 2022-08-06 + Version 1.55 + Release date: 2022-09-23 by diff --git a/xtrn/DDMsgReader/revision_history.txt b/xtrn/DDMsgReader/revision_history.txt index 27ba8f5198..e139d9dd95 100644 --- a/xtrn/DDMsgReader/revision_history.txt +++ b/xtrn/DDMsgReader/revision_history.txt @@ -5,6 +5,9 @@ Revision History (change log) ============================= Version Date Description ------- ---- ----------- +1.55 2022-09-23 Refactored how email replies are done (passing the header + to the appropriate functions, not using ungetstr() when + prompting for the message subject) 1.54 2022-08-06 Users now have a personal twit list, configurable via user settings, with the Ctrl-U hotkey. 1.53 2022-07-18 Deleted messages can now be un-marked for deletion from -- GitLab