Skip to content
Snippets Groups Projects

Bug fix for net type when forwarding messages to internet email or fidonet netmail

Merged Eric Oulashin requested to merge DDMsgReader_forward_net_type into master
5 unresolved threads
3 files
+ 68
7
Compare changes
  • Side-by-side
  • Inline
Files
3
// $Id: DDMsgReader.js,v 1.144 2020/07/11 23:07:46 nightfox Exp $
// $Id: DDMsgReader.js,v 1.143 2020/05/23 23:30:28 nightfox Exp $
/* This is a message reader/lister door for Synchronet. Features include:
* - Listing messages in the user's current message area with the ability to
@@ -69,6 +69,10 @@
* Added mouse support to the scrollable reader interface.
* The integrated area changer functionality doesn't have mouse
* support yet.
* 2020-11-26 Eric Oulashin Verison 1.38
* Bug fix: When forwarding a message, it now correctly
* sets the to_net_type property in the message header to
* FidoNet or internet for those types of message destinations
*/
@@ -180,8 +184,8 @@ if (system.version_num < 31500)
}
// Reader version information
var READER_VERSION = "1.37";
var READER_DATE = "2020-07-11";
var READER_VERSION = "1.38";
var READER_DATE = "2020-11-26";
// Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24);
@@ -13303,7 +13307,7 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody)
return "Invalid message header given";
var retStr = "";
console.print("\1n");
console.crlf();
console.print("\1cUser name/number/email address\1h:\1n");
@@ -13356,9 +13360,13 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody)
var destMsgHdr = { to_net_type: NET_NONE, from: user.name,
replyto: user.name, subject: "Fwd: " + pMsgHdr.subject };
if (user.netmail.length > 0)
{
destMsgHdr.replyto_net_addr = user.netmail;
}
else
{
destMsgHdr.replyto_net_addr = user.email;
}
//destMsgHdr.when_written_time =
//destMsgHdr.when_written_zone = system.timezone;
//destMsgHdr.when_written_zone_offset =
@@ -13380,7 +13388,7 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody)
console.crlf();
destMsgHdr.to = msgDest;
destMsgHdr.to_net_addr = msgDest;
destMsgHdr.to_net_type = NET_INTERNET;
destMsgHdr.to_net_type = netaddr_type(msgDest);
}
}
else
@@ -13430,6 +13438,7 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody)
console.print("\1n\1cForwarding to " + destUser.alias + "\1n");
console.crlf();
destMsgHdr.to_ext = destUser.number;
destMsgHdr.to_net_type = NET_NONE;
}
}
}
@@ -13472,6 +13481,54 @@ function DigDistMsgReader_ForwardMessage(pMsgHdr, pMsgBody)
return retStr;
}
function printMsgHdrInfo(pMsgHdr)
{
if (typeof(pMsgHdr) != "object")
return;
for (var prop in pMsgHdr)
{
if (prop == "to_net_type")
print(prop + ": " + toNetTypeToStr(pMsgHdr[prop]));
else
console.print(prop + ": " + pMsgHdr[prop]);
console.crlf();
}
}
function toNetTypeToStr(toNetType)
{
var toNetTypeStr = "Unknown";
if (typeof(toNetType) == "number")
{
switch (toNetType)
{
case NET_NONE:
toNetTypeStr = "Local";
break;
case NET_UNKNOWN:
toNetTypeStr = "Unknown networked";
break;
case NET_FIDO:
toNetTypeStr = "FidoNet";
break;
case NET_POSTLINK:
toNetTypeStr = "PostLink";
break;
case NET_QWK:
toNetTypeStr = "QWK";
break;
case NET_INTERNET:
Please register or sign in to reply
toNetTypeStr = "Internet";
break;
default:
toNetTypeStr = "Unknown";
break;
}
}
return toNetTypeStr;
}
// For the DigDistMsgReader class: Lets the user vote on a message
//
// Parameters:
Loading