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

DDMsgReader v1.45: Fixed message scanning & searching issues introduced in the previous version.

parent 764630cf
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!145DDMsgReader v1.45: Fixed message scanning & searching issues introduced in the previous version.
Pipeline #2778 passed
...@@ -112,6 +112,9 @@ ...@@ -112,6 +112,9 @@
* to ensure they only have Synchronet attribute codes. * to ensure they only have Synchronet attribute codes.
* 2022-02-19 Eric Oulashin Version 1.44 * 2022-02-19 Eric Oulashin Version 1.44
* Releasing this version. * Releasing this version.
* 2022-02-24 Eric Oulashin Version 1.45
* Fixed message scanning & searching issue introduced in the
* previous version.
*/ */
   
   
...@@ -232,8 +235,8 @@ if (system.version_num < 31500) ...@@ -232,8 +235,8 @@ if (system.version_num < 31500)
} }
   
// Reader version information // Reader version information
var READER_VERSION = "1.44"; var READER_VERSION = "1.45";
var READER_DATE = "2022-02-19"; var READER_DATE = "2022-02-24";
   
// 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);
...@@ -1817,6 +1820,13 @@ function DigDistMsgReader_SearchMessages(pSearchModeStr, pSubBoardCode, pScanSco ...@@ -1817,6 +1820,13 @@ function DigDistMsgReader_SearchMessages(pSearchModeStr, pSubBoardCode, pScanSco
var continueScan = true; var continueScan = true;
var userAborted = false; var userAborted = false;
this.doingMultiSubBoardScan = (subBoardsToScan.length > 1); this.doingMultiSubBoardScan = (subBoardsToScan.length > 1);
// If the sub-board's access requirements allows the user to read it
// and it's enabled in the user's message scan configuration, then go
// ahead with this sub-board.
// Note: Used to use this to determine whether the user could access the
// sub-board:
//user.compare_ars(msg_area.grp_list[grpIndex].sub_list[subIndex].ars)
// Now using the can_read property.
for (var subCodeIdx = 0; (subCodeIdx < subBoardsToScan.length) && continueScan; ++subCodeIdx) for (var subCodeIdx = 0; (subCodeIdx < subBoardsToScan.length) && continueScan; ++subCodeIdx)
{ {
subCode = subBoardsToScan[subCodeIdx]; subCode = subBoardsToScan[subCodeIdx];
...@@ -1828,16 +1838,9 @@ function DigDistMsgReader_SearchMessages(pSearchModeStr, pSubBoardCode, pScanSco ...@@ -1828,16 +1838,9 @@ function DigDistMsgReader_SearchMessages(pSearchModeStr, pSubBoardCode, pScanSco
// when the "Searching ..." and "No messages were found" text is // when the "Searching ..." and "No messages were found" text is
// displayed repeatedly // displayed repeatedly
console.line_counter = 0; console.line_counter = 0;
// If the sub-board's access requirements allows the user to read it // let the user read the sub-board (and toggle betweeen reading and
// and it's enabled in the user's message scan configuration, then go // listing)
// ahead with this sub-board. var readOrListRetObj = this.ReadOrListSubBoard(subCode, null, true, true, false, true, READER_MODE_READ);
// Note: Used to use this to determine whether the user could access the
// sub-board:
//user.compare_ars(msg_area.grp_list[grpIndex].sub_list[subIndex].ars)
// Now using the can_read property.
// TODO: It seems ReadOrListSubBoard() does its own loop through
// the sub-boards if the user chooses to go to the next one
var readOrListRetObj = this.ReadOrListSubBoard(subCode, null, true, false, false, false);
console.print("\1n"); console.print("\1n");
console.crlf(); console.crlf();
//if (this.SearchTypePopulatesSearchResults()) //if (this.SearchTypePopulatesSearchResults())
...@@ -1848,6 +1851,7 @@ function DigDistMsgReader_SearchMessages(pSearchModeStr, pSubBoardCode, pScanSco ...@@ -1848,6 +1851,7 @@ function DigDistMsgReader_SearchMessages(pSearchModeStr, pSubBoardCode, pScanSco
} }
} }
this.subBoardCode = subBoardCodeBackup; this.subBoardCode = subBoardCodeBackup;
console.pause();
} }
else else
this.ReadOrListSubBoard(subCode); this.ReadOrListSubBoard(subCode);
...@@ -1927,6 +1931,9 @@ function DigDistMsgReader_ClearSearchData() ...@@ -1927,6 +1931,9 @@ function DigDistMsgReader_ClearSearchData()
// pPromptToGoNextIfNoResults: Optional boolean - Whether or not to prompt the user // pPromptToGoNextIfNoResults: Optional boolean - Whether or not to prompt the user
// to go onto the next/previous sub-board if there are no // to go onto the next/previous sub-board if there are no
// search results in the current sub-board. Defaults to true. // search results in the current sub-board. Defaults to true.
// pInitialModeOverride: Optional (numeric) to override the initial mode in this
// function (READER_MODE_READ or READER_MODE_LIST). If not
// specified, defaults to this.startMode.
// //
// Return value: An object with the following properties: // Return value: An object with the following properties:
// stoppedReading: Boolean - Whether or not the user stopped reading. // stoppedReading: Boolean - Whether or not the user stopped reading.
...@@ -1934,7 +1941,8 @@ function DigDistMsgReader_ClearSearchData() ...@@ -1934,7 +1941,8 @@ function DigDistMsgReader_ClearSearchData()
function DigDistMsgReader_ReadOrListSubBoard(pSubBoardCode, pStartingMsgOffset, function DigDistMsgReader_ReadOrListSubBoard(pSubBoardCode, pStartingMsgOffset,
pAllowChgArea, pReturnOnNextAreaNav, pAllowChgArea, pReturnOnNextAreaNav,
pPauseOnNoMsgSrchResults, pPauseOnNoMsgSrchResults,
pPromptToGoNextIfNoResults) pPromptToGoNextIfNoResults,
pInitialModeOverride)
{ {
var retObj = { var retObj = {
stoppedReading: false stoppedReading: false
...@@ -2002,6 +2010,9 @@ function DigDistMsgReader_ReadOrListSubBoard(pSubBoardCode, pStartingMsgOffset, ...@@ -2002,6 +2010,9 @@ function DigDistMsgReader_ReadOrListSubBoard(pSubBoardCode, pStartingMsgOffset,
// Determine whether to start in list or reader mode, depending // Determine whether to start in list or reader mode, depending
// on the value of this.startMode. // on the value of this.startMode.
var readerMode = this.startMode; var readerMode = this.startMode;
// If an initial mode override was specified and is valid, then use it.
if (typeof(pInitialModeOverride) === "number" && (pInitialModeOverride == READER_MODE_READ || pInitialModeOverride == READER_MODE_LIST))
readerMode = pInitialModeOverride;
// User input loop // User input loop
var selectedMessageOffset = 0; var selectedMessageOffset = 0;
if (typeof(pStartingMsgOffset) == "number") if (typeof(pStartingMsgOffset) == "number")
...@@ -2061,6 +2072,7 @@ function DigDistMsgReader_ReadOrListSubBoard(pSubBoardCode, pStartingMsgOffset, ...@@ -2061,6 +2072,7 @@ function DigDistMsgReader_ReadOrListSubBoard(pSubBoardCode, pStartingMsgOffset,
} }
else if (otherRetObj.messageListReturn) else if (otherRetObj.messageListReturn)
readerMode = READER_MODE_LIST; readerMode = READER_MODE_LIST;
break;
case READER_MODE_LIST: case READER_MODE_LIST:
// Note: Doing the message list is also handled in this.ReadMessages(). // Note: Doing the message list is also handled in this.ReadMessages().
// This code is here in case the reader is configured to start up // This code is here in case the reader is configured to start up
...@@ -2883,7 +2895,6 @@ function DigDistMsgReader_ReadMessages(pSubBoardCode, pStartingMsgOffset, pRetur ...@@ -2883,7 +2895,6 @@ function DigDistMsgReader_ReadMessages(pSubBoardCode, pStartingMsgOffset, pRetur
{ {
if (allowChgMsgArea && !pReturnOnNextAreaNav) if (allowChgMsgArea && !pReturnOnNextAreaNav)
{ {
console.print("\1nHere!!!! \1p"); // Temporary
var goToNextRetval = this.GoToNextSubBoardForEnhReader(allowChgMsgArea, pPromptToGoToNextAreaIfNoSearchResults); var goToNextRetval = this.GoToNextSubBoardForEnhReader(allowChgMsgArea, pPromptToGoToNextAreaIfNoSearchResults);
retObj.stoppedReading = goToNextRetval.shouldStopReading; retObj.stoppedReading = goToNextRetval.shouldStopReading;
if (retObj.stoppedReading) if (retObj.stoppedReading)
...@@ -3827,16 +3838,6 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard) ...@@ -3827,16 +3838,6 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard)
// S: Sorting options // S: Sorting options
else if (lastUserInputUpper == "S") else if (lastUserInputUpper == "S")
{ {
if (user.is_sysop) // Temporary
{
console.gotoxy(1, console.screen_rows);
console.cleartoeol("\1n");
console.gotoxy(1, console.screen_rows);
console.print("\1gSort\1n");
mswait(ERROR_PAUSE_WAIT_MS);
}
// Refresh the help line // Refresh the help line
DisplayHelpLine(this.msgListLightbarModeHelpLine); DisplayHelpLine(this.msgListLightbarModeHelpLine);
} }
...@@ -6984,9 +6985,9 @@ function DigDistMsgReader_WriteMsgListScreenTopHeader() ...@@ -6984,9 +6985,9 @@ function DigDistMsgReader_WriteMsgListScreenTopHeader()
// Figure out the message group name & sub-board name // Figure out the message group name & sub-board name
// For the message group name, we can also use msgbase.cfg.grp_name in // For the message group name, we can also use msgbase.cfg.grp_name in
// Synchronet 3.12 and higher. // Synchronet 3.12 and higher.
var msgbase = new MsgBase(this.subBoardCode);
var msgGroupName = msg_area.grp_list[msgbase.cfg.grp_number].description; var msgGroupName = msg_area.grp_list[msgbase.cfg.grp_number].description;
var subBoardName = "Unspecified"; var subBoardName = "Unspecified";
var msgbase = new MsgBase(this.subBoardCode);
if (msgbase.open()) if (msgbase.open())
{ {
if (msgbase.cfg != null) if (msgbase.cfg != null)
...@@ -10536,13 +10537,13 @@ function DigDistMsgReader_PromptAndDeleteSelectedMessages(pPromptLoc, pClearProm ...@@ -10536,13 +10537,13 @@ function DigDistMsgReader_PromptAndDeleteSelectedMessages(pPromptLoc, pClearProm
{ {
if (promptLocValid) if (promptLocValid)
{ {
var delMsgsPromptText = replaceAtCodesInStr(this.text.delSelectedMsgsConfirmText);
// If the caller wants to clear the remainder of the row where the prompt // If the caller wants to clear the remainder of the row where the prompt
// text will be, then do it. // text will be, then do it.
if (pClearPromptRowAtFirstUse) if (pClearPromptRowAtFirstUse)
{ {
// Adding 5 to the prompt text to account for the ? and "[X] " that // Adding 5 to the prompt text to account for the ? and "[X] " that
// will be added when console.noyes() is called // will be added when console.noyes() is called
var delMsgsPromptText = replaceAtCodesInStr(this.text.delSelectedMsgsConfirmText);
var promptTxtLen = console.strlen(delMsgsPromptText) + 5; var promptTxtLen = console.strlen(delMsgsPromptText) + 5;
var numCharsRemaining = 0; var numCharsRemaining = 0;
if (typeof(pPromptRowWidth) == "number") if (typeof(pPromptRowWidth) == "number")
...@@ -10556,9 +10557,9 @@ function DigDistMsgReader_PromptAndDeleteSelectedMessages(pPromptLoc, pClearProm ...@@ -10556,9 +10557,9 @@ function DigDistMsgReader_PromptAndDeleteSelectedMessages(pPromptLoc, pClearProm
} }
// Move the cursor to the prompt location // Move the cursor to the prompt location
console.gotoxy(pPromptLoc); console.gotoxy(pPromptLoc);
}
deleteMsgs = !console.noyes(delMsgsPromptText); deleteMsgs = !console.noyes(delMsgsPromptText);
} }
}
// If we are to delete the messages, then delete it. // If we are to delete the messages, then delete it.
if (deleteMsgs) if (deleteMsgs)
{ {
......
Digital Distortion Message Reader Digital Distortion Message Reader
Version 1.44 Version 1.45
Release date: 2022-02-19 Release date: 2022-02-24
by by
......
...@@ -5,6 +5,8 @@ Revision History (change log) ...@@ -5,6 +5,8 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
1.45 2022-02-24 Fixed message scanning & searching issue introduced in the
previous version.
1.44 2022-02-19 Removed the scanScopePromptText text line and used the 1.44 2022-02-19 Removed the scanScopePromptText text line and used the
SubGroupOrAll line (621) from text.dat instead. Also, the SubGroupOrAll line (621) from text.dat instead. Also, the
reader now supports @-code expansion in configured text reader now supports @-code expansion in configured text
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment