* to Synchronet attribute codes, with the new configuration setting
* convertYStyleMCIAttrsToSync (true/false). Requires the updated attr_conv.js
* in sbbs/exec/load.
* 2023-01-22 Eric Oulashin Version 1.61
* Fix: When replying to an email with an unknown sender (empty),
* no longer gives the error "Invalid user field: 0"; also, if the sender is
* unknown, prompts the user for a user name/number/email address to send
* the reply to.
*/
"use strict";
...
...
@@ -184,8 +189,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a');
// Reader version information
var READER_VERSION = "1.60";
var READER_DATE = "2023-01-20";
var READER_VERSION = "1.61";
var READER_DATE = "2023-01-22";
// Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24);
...
...
@@ -404,7 +409,7 @@ if (typeof(MSG_MIMEATTACH) != "undefined")
// A regular expression to check whether a string is an email address
var gEmailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// A regular expression to check whether a string is a FidoNet email address
var gFTNEmailregex = /^.*@[0-9]+:[0-9]+\/[0-9]+$/;
var gFTNEmailRegex = /^.*@[0-9]+:[0-9]+\/[0-9]+$/;
// An array of regular expressions for checking for ANSI codes (globally in a string & ignore case)
var gANSIRegexes = [ new RegExp(ascii(27) + "\[[0-9]+[mM]", "gi"),
new RegExp(ascii(27) + "\[[0-9]+(;[0-9]+)+[mM]", "gi"),
...
...
@@ -4745,12 +4750,6 @@ function DigDistMsgReader_ReadMessageEnhanced(pOffset, pAllowChgArea)
else
allowChgMsgArea = (this.subBoardCode != "mail");
// Hack: If the "from" name in the header is empty (as it might be sometimes), then
// set it to "All". This prevents Synchronet from crashing, and it will also default
// the "to" name in the user's reply to "All".
if (msgHeader.from.length == 0)
msgHeader.from = "All";
// Get the message text and see if it has any ANSI codes. Remove any pause
// codes it might have. If it has ANSI codes, then don't use the scrolling
// interface so that the ANSI gets displayed properly.
...
...
@@ -10026,16 +10025,17 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode)
replyMode |= pReplyMode;
// If the message is a networked message, then try to address the message
// to the network address. Otherwise, try to look up the user to reply
// locally.
var replyLocally = true;
// to the network address.
var couldNotDetermineNetAddr = true;
var wasNetMailOrigin = false;
if ((typeof(pMsgHdr.from_net_type) != "undefined") && (pMsgHdr.from_net_type != NET_NONE))
{
if (user.is_sysop) console.print("\x01n\r\nHere 1\r\n\x01p"); // Temporary
wasNetMailOrigin = true;
if ((typeof(pMsgHdr.from_net_addr) == "string") && (pMsgHdr.from_net_addr.length > 0))
{
replyLocally = false;
if (user.is_sysop) console.print("\x01n\r\nHere 2\r\n\x01p"); // Temporary
couldNotDetermineNetAddr = false;
// Build the email address to reply to. If the original message is
// internet email, then simply use the from_net_addr field from the
// message header. Otherwise (i.e., on a networked sub-board), use
...
...
@@ -10043,6 +10043,7 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode)
var emailAddr = "";
if (typeof(pMsgHdr.from_net_addr) === "string" && pMsgHdr.from_net_addr.length > 0)
{
if (user.is_sysop) console.print("\x01n\r\nHere 3\r\n\x01p"); // Temporary
if (pMsgHdr.from_net_type == NET_INTERNET)
emailAddr = pMsgHdr.from_net_addr;
else
...
...
@@ -10053,21 +10054,25 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode)