Skip to content
Snippets Groups Projects
Commit d01eae19 authored by Eric Oulashin's avatar Eric Oulashin
Browse files

DDMsgReader: After replying to a message, when status is shown and pauses for...

DDMsgReader: After replying to a message, when status is shown and pauses for user input, Q or Ctrl-C will now exit, and not be ignored.  Requested by Keyop.
parent 9e801052
No related branches found
No related tags found
1 merge request!500DDMsgReader: After replying to a message, when status is shown and pauses for user input, Q or Ctrl-C will now exit, and not be ignored. Requested by Keyop.
Pipeline #8328 passed
...@@ -228,6 +228,9 @@ ...@@ -228,6 +228,9 @@
* timeout warning occurs. The string is configurable via the new * timeout warning occurs. The string is configurable via the new
* areYouThere string in the theme file. * areYouThere string in the theme file.
* (Started: 2025-01-29) * (Started: 2025-01-29)
* 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.
*/ */
   
"use strict"; "use strict";
...@@ -335,8 +338,8 @@ var hexdump = load('hexdump_lib.js'); ...@@ -335,8 +338,8 @@ var hexdump = load('hexdump_lib.js');
   
   
// Reader version information // Reader version information
var READER_VERSION = "1.96k"; var READER_VERSION = "1.96L";
var READER_DATE = "2025-02-08"; var READER_DATE = "2025-02-18";
   
// Keyboard key codes for displaying on the screen // Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24); var UP_ARROW = ascii(24);
...@@ -5999,6 +6002,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Scrollable(msgHeader, allowChgMsgA ...@@ -5999,6 +6002,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Scrollable(msgHeader, allowChgMsgA
// If the user pressed the private reply key while reading private // If the user pressed the private reply key while reading private
// mail, then do nothing (allow only the regular reply key to reply). // mail, then do nothing (allow only the regular reply key to reply).
var privateReply = (retObj.lastKeypress == this.enhReaderKeys.privateReply); var privateReply = (retObj.lastKeypress == this.enhReaderKeys.privateReply);
var userQuitOrAborted = false;
if (privateReply && this.readingPersonalEmail) if (privateReply && this.readingPersonalEmail)
writeMessage = false; // Don't re-write the current message again writeMessage = false; // Don't re-write the current message again
else else
...@@ -6013,6 +6017,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Scrollable(msgHeader, allowChgMsgA ...@@ -6013,6 +6017,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Scrollable(msgHeader, allowChgMsgA
// Let the user reply to the message. // Let the user reply to the message.
var replyRetObj = this.ReplyToMsg(extdMsgHdr, messageText, privateReply, pOffset); var replyRetObj = this.ReplyToMsg(extdMsgHdr, messageText, privateReply, pOffset);
retObj.userReplied = replyRetObj.postSucceeded; retObj.userReplied = replyRetObj.postSucceeded;
userQuitOrAborted = replyRetObj.userQuitOrAborted;
//retObj.msgNotReadable = replyRetObj.msgWasDeleted; //retObj.msgNotReadable = replyRetObj.msgWasDeleted;
var msgWasDeleted = replyRetObj.msgWasDeleted; var msgWasDeleted = replyRetObj.msgWasDeleted;
//if (retObj.msgNotReadable) //if (retObj.msgNotReadable)
...@@ -6057,6 +6062,28 @@ function DigDistMsgReader_ReadMessageEnhanced_Scrollable(msgHeader, allowChgMsgA ...@@ -6057,6 +6062,28 @@ function DigDistMsgReader_ReadMessageEnhanced_Scrollable(msgHeader, allowChgMsgA
writeMessage = true; // We want to refresh the message on the screen writeMessage = true; // We want to refresh the message on the screen
} }
} }
else
{
// Messagebase failed to open
this.DisplayEnhReaderError("Messagebase failed to open", msgInfo.messageLines, topMsgLineIdx, msgLineFormatStr);
}
}
// If the user quit/aborted, then quit out of reader mode now.
// Resetting console.aborted and line_counter to avoid pausing and screen display issues.
console.aborted = false;
console.line_counter = 0;
if (userQuitOrAborted)
{
if (this.userSettings.quitFromReaderGoesToMsgList)
{
console.attributes = "N";
console.crlf();
console.print("Loading...");
retObj.nextAction = ACTION_DISPLAY_MSG_LIST;
}
else
retObj.nextAction = ACTION_QUIT;
continueOn = false;
} }
break; break;
case this.enhReaderKeys.postMsg: // Post a message case this.enhReaderKeys.postMsg: // Post a message
...@@ -7549,6 +7576,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Traditional(msgHeader, allowChgMsg ...@@ -7549,6 +7576,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Traditional(msgHeader, allowChgMsg
// If not reading personal email, go ahead and let the user reply // If not reading personal email, go ahead and let the user reply
// with either the reply or private reply keypress. // with either the reply or private reply keypress.
var privateReply = (retObj.lastKeypress == this.enhReaderKeys.privateReply); var privateReply = (retObj.lastKeypress == this.enhReaderKeys.privateReply);
var userQuitOrAborted = false;
if (privateReply && this.readingPersonalEmail) if (privateReply && this.readingPersonalEmail)
{ {
writeMessage = false; // Don't re-write the current message again writeMessage = false; // Don't re-write the current message again
...@@ -7567,6 +7595,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Traditional(msgHeader, allowChgMsg ...@@ -7567,6 +7595,7 @@ function DigDistMsgReader_ReadMessageEnhanced_Traditional(msgHeader, allowChgMsg
// Let the user reply to the message // Let the user reply to the message
var replyRetObj = this.ReplyToMsg(extdMsgHdr, messageText, privateReply, pOffset); var replyRetObj = this.ReplyToMsg(extdMsgHdr, messageText, privateReply, pOffset);
retObj.userReplied = replyRetObj.postSucceeded; retObj.userReplied = replyRetObj.postSucceeded;
userQuitOrAborted = replyRetObj.userQuitOrAborted;
//retObj.msgNotReadable = replyRetObj.msgWasDeleted; //retObj.msgNotReadable = replyRetObj.msgWasDeleted;
var msgWasDeleted = replyRetObj.msgWasDeleted; var msgWasDeleted = replyRetObj.msgWasDeleted;
if (msgWasDeleted && !canViewDeletedMsgs()) if (msgWasDeleted && !canViewDeletedMsgs())
...@@ -7596,6 +7625,23 @@ function DigDistMsgReader_ReadMessageEnhanced_Traditional(msgHeader, allowChgMsg ...@@ -7596,6 +7625,23 @@ function DigDistMsgReader_ReadMessageEnhanced_Traditional(msgHeader, allowChgMsg
mswait(ERROR_PAUSE_WAIT_MS); mswait(ERROR_PAUSE_WAIT_MS);
} }
} }
// If the user quit/aborted, then quit out of reader mode now.
// Resetting console.aborted and line_counter to avoid pausing and screen display issues.
console.aborted = false;
console.line_counter = 0;
if (userQuitOrAborted)
{
if (this.userSettings.quitFromReaderGoesToMsgList)
{
console.attributes = "N";
console.crlf();
console.print("Loading...");
retObj.nextAction = ACTION_DISPLAY_MSG_LIST;
}
else
retObj.nextAction = ACTION_QUIT;
continueOn = false;
}
break; break;
case this.enhReaderKeys.postMsg: // Post a message case this.enhReaderKeys.postMsg: // Post a message
if (!this.readingPersonalEmail) if (!this.readingPersonalEmail)
...@@ -11521,11 +11567,13 @@ function DigDistMsgReader_EnhancedReaderChangeSubBoard(pNewSubBoardCode) ...@@ -11521,11 +11567,13 @@ function DigDistMsgReader_EnhancedReaderChangeSubBoard(pNewSubBoardCode)
// postSucceeded: Boolean - Whether or not the message post succeeded // postSucceeded: Boolean - Whether or not the message post succeeded
// msgWasDeleted: Boolean - Whether or not the message was deleted after // msgWasDeleted: Boolean - Whether or not the message was deleted after
// the user replied to it // the user replied to it
// userQuitOrAborted: Whether or not the user quit/aborted
function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx) function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx)
{ {
var retObj = { var retObj = {
postSucceeded: false, postSucceeded: false,
msgWasDeleted: false msgWasDeleted: false,
userQuitOrAborted: false
}; };
   
if (pMsgHdr == null || typeof(pMsgHdr) !== "object") if (pMsgHdr == null || typeof(pMsgHdr) !== "object")
...@@ -11615,6 +11663,7 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx) ...@@ -11615,6 +11663,7 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx)
var privReplRetObj = this.DoPrivateReply(pMsgHdr, pMsgIdx, replyMode); var privReplRetObj = this.DoPrivateReply(pMsgHdr, pMsgIdx, replyMode);
retObj.postSucceeded = privReplRetObj.sendSucceeded; retObj.postSucceeded = privReplRetObj.sendSucceeded;
retObj.msgWasDeleted = privReplRetObj.msgWasDeleted; retObj.msgWasDeleted = privReplRetObj.msgWasDeleted;
retObj.userQuitOrAborted = privReplRetObj.userQuitOrAborted;
// If the user successfully saved the message and the message wasn't deleted, // If the user successfully saved the message and the message wasn't deleted,
// then apply the 'replied' attribute to the message Header // then apply the 'replied' attribute to the message Header
if (privReplRetObj.sendSucceeded && !privReplRetObj.msgWasDeleted) if (privReplRetObj.sendSucceeded && !privReplRetObj.msgWasDeleted)
...@@ -11710,6 +11759,7 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx) ...@@ -11710,6 +11759,7 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx)
var privReplRetObj = this.DoPrivateReply(pMsgHdr, pMsgIdx, replyMode); var privReplRetObj = this.DoPrivateReply(pMsgHdr, pMsgIdx, replyMode);
retObj.postSucceeded = privReplRetObj.sendSucceeded; retObj.postSucceeded = privReplRetObj.sendSucceeded;
retObj.msgWasDeleted = privReplRetObj.msgWasDeleted; retObj.msgWasDeleted = privReplRetObj.msgWasDeleted;
retObj.userQuitOrAborted = privReplRetObj.userQuitOrAborted;
} }
else else
{ {
...@@ -11718,6 +11768,7 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx) ...@@ -11718,6 +11768,7 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx)
// Error: Error -300 adding RFC822MSGID field to message header // Error: Error -300 adding RFC822MSGID field to message header
retObj.postSucceeded = bbs.post_msg(this.subBoardCode, replyMode, pMsgHdr); retObj.postSucceeded = bbs.post_msg(this.subBoardCode, replyMode, pMsgHdr);
console.pause(); console.pause();
retObj.userQuitOrAborted = console.aborted;
} }
// Remove the messagebase info drop file if it exists // Remove the messagebase info drop file if it exists
if (file_exists(msgbaseInfoDropFileName)) if (file_exists(msgbaseInfoDropFileName))
...@@ -11800,11 +11851,13 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx) ...@@ -11800,11 +11851,13 @@ function DigDistMsgReader_ReplyToMsg(pMsgHdr, pMsgText, pPrivate, pMsgIdx)
// sendSucceeded: Boolean - Whether or not the message post succeeded // sendSucceeded: Boolean - Whether or not the message post succeeded
// msgWasDeleted: Boolean - Whether or not the message was deleted after // msgWasDeleted: Boolean - Whether or not the message was deleted after
// the user replied to it // the user replied to it
// userQuitOrAborted: Whether or not the user quit/aborted
function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode) function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode)
{ {
var retObj = { var retObj = {
sendSucceeded: true, sendSucceeded: true,
msgWasDeleted: false msgWasDeleted: false,
userQuitOrAborted: false
}; };
if (pMsgHdr == null) if (pMsgHdr == null)
...@@ -11874,6 +11927,7 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode) ...@@ -11874,6 +11927,7 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode)
console.crlf(); console.crlf();
retObj.sendSucceeded = bbs.email(userNumber, replyMode, null, null, pMsgHdr); retObj.sendSucceeded = bbs.email(userNumber, replyMode, null, null, pMsgHdr);
console.pause(); console.pause();
retObj.userQuitOrAborted = console.aborted;
} }
else else
{ {
...@@ -11925,12 +11979,14 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode) ...@@ -11925,12 +11979,14 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode)
{ {
replyMode |= WM_NETMAIL; replyMode |= WM_NETMAIL;
retObj.sendSucceeded = bbs.netmail(msgDest, replyMode, null, pMsgHdr); retObj.sendSucceeded = bbs.netmail(msgDest, replyMode, null, pMsgHdr);
retObj.userQuitOrAborted = console.aborted;
console.pause(); console.pause();
} }
else else
{ {
console.crlf(); console.crlf();
retObj.sendSucceeded = bbs.email(userNumber, replyMode, null, null, pMsgHdr); retObj.sendSucceeded = bbs.email(userNumber, replyMode, null, null, pMsgHdr);
retObj.userQuitOrAborted = console.aborted;
console.pause(); console.pause();
} }
} }
...@@ -11969,6 +12025,7 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode) ...@@ -11969,6 +12025,7 @@ function DigDistMsgReader_DoPrivateReply(pMsgHdr, pMsgIdx, pReplyMode)
// results. // results.
if (!console.noyes(bbs.text(DeleteMailQ).replace("%s", pMsgHdr.from))) if (!console.noyes(bbs.text(DeleteMailQ).replace("%s", pMsgHdr.from)))
retObj.msgWasDeleted = this.PromptAndDeleteOrUndeleteMessage(pMsgIdx, null, true, null, null, false); retObj.msgWasDeleted = this.PromptAndDeleteOrUndeleteMessage(pMsgIdx, null, true, null, null, false);
retObj.userQuitOrAborted = console.aborted;
} }
   
return retObj; return retObj;
...@@ -17509,8 +17566,11 @@ function DigDistMsgReader_ScrollableModeAreYouThereWarning() ...@@ -17509,8 +17566,11 @@ function DigDistMsgReader_ScrollableModeAreYouThereWarning()
console.beep(); console.beep();
//var warningTxt = "Are you there??"; //var warningTxt = "Are you there??";
var warningTxt = replaceAtCodesInStr(this.text.areYouThere); var warningTxt = replaceAtCodesInStr(this.text.areYouThere);
var numSpaces = Math.floor(this.scrollableReadingData.msgAreaWidth / 2) - Math.floor(warningTxt.length / 2); if (console.strlen(warningTxt) > console.screen_columns)
warningTxt = format("%*s", numSpaces, "") + warningTxt + format("%*s", numSpaces-1, ""); warningTxt = "\x01n\x01hAre you really there?\x01n";
var numSpaces = Math.floor(this.scrollableReadingData.msgAreaWidth / 2) - Math.floor(console.strlen(warningTxt) / 2);
if (numSpaces > 0)
warningTxt = format("%*s", numSpaces, "") + warningTxt;
this.WriteLightbarKeyHelpMsg(warningTxt, "\x01n\x01h\x01y\x01h", ERROR_WAIT_MS); this.WriteLightbarKeyHelpMsg(warningTxt, "\x01n\x01h\x01y\x01h", ERROR_WAIT_MS);
   
if (this.currentAction == ACTION_READING_MSG && this.scrollingReaderInterface && console.term_supports(USER_ANSI)) if (this.currentAction == ACTION_READING_MSG && this.scrollingReaderInterface && console.term_supports(USER_ANSI))
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// If you have DDMsgReader in a directory other than xtrn/DDMsgReader, then the changes to // 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 // DDMsgReader.cfg will be saved in that directory (assuming you're running ddmr_cfg.js from
// that same directory). // that same directory).
// Currently for DDMsgReader 1.96k. // Currently for DDMsgReader 1.96L.
// //
// If you're running DDMsgReader from xtrn/DDMsgReader (the standard location) and you want // 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 // 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"); ...@@ -18,7 +18,7 @@ require("sbbsdefs.js", "P_NONE");
require("uifcdefs.js", "UIFC_INMSG"); require("uifcdefs.js", "UIFC_INMSG");
if (!uifc.init("DigDist. Message Reader 1.96k Configurator")) if (!uifc.init("DigDist. Message Reader 1.96L Configurator"))
{ {
print("Failed to initialize uifc"); print("Failed to initialize uifc");
exit(1); exit(1);
......
Digital Distortion Message Reader Digital Distortion Message Reader
Version 1.96k Version 1.96L
Release date: 2025-02-08 Release date: 2025-02-18
by by
......
...@@ -5,6 +5,9 @@ Revision History (change log) ...@@ -5,6 +5,9 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
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.
1.96k 2025-02-08 Input timeout alert improvement - Rather than just 1.96k 2025-02-08 Input timeout alert improvement - Rather than just
blanking out the AreYouThere text (which still allows the blanking out the AreYouThere text (which still allows the
alert sound), now also writes a text string at the bottom alert sound), now also writes a text string at the bottom
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment