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

DDMsgReader: Allows kwyeord searching of personal email with command-line arguments

parent c5c36eb9
Branches
Tags
No related merge requests found
...@@ -135,6 +135,9 @@ ...@@ -135,6 +135,9 @@
* Settings for users being able to read deleted messages now applies to * Settings for users being able to read deleted messages now applies to
* personal email. Also, allows reading messages that are marked for deletion * personal email. Also, allows reading messages that are marked for deletion
* in addition to just seeing them in the message list. * in addition to just seeing them in the message list.
* 2023-08-16 Eric Oulashin Version 1.75
* Made some changes to allow easy searching of personal email with
* command-line arguments.
*/ */
   
"use strict"; "use strict";
...@@ -241,8 +244,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a'); ...@@ -241,8 +244,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a');
   
   
// Reader version information // Reader version information
var READER_VERSION = "1.74"; var READER_VERSION = "1.75";
var READER_DATE = "2023-05-13"; var READER_DATE = "2023-08-16";
   
// 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);
...@@ -729,6 +732,7 @@ if (gDoDDMR) ...@@ -729,6 +732,7 @@ if (gDoDDMR)
console.attributes = "N"; console.attributes = "N";
} }
   
exit();
// End of script execution. Functions below: // End of script execution. Functions below:
   
// Generates an internal enhanced reader header line for the 'To' user. // Generates an internal enhanced reader header line for the 'To' user.
...@@ -1029,7 +1033,7 @@ function DigDistMsgReader(pSubBoardCode, pScriptArgs) ...@@ -1029,7 +1033,7 @@ function DigDistMsgReader(pSubBoardCode, pScriptArgs)
searchingSubBoardText: "\x01n\x01cSearching \x01h%s\x01n\x01c...", searchingSubBoardText: "\x01n\x01cSearching \x01h%s\x01n\x01c...",
scanningSubBoardText: "\x01n\x01cScanning \x01h%s\x01n\x01c...", scanningSubBoardText: "\x01n\x01cScanning \x01h%s\x01n\x01c...",
noMessagesInSubBoardText: "\x01n\x01h\x01bThere are no messages in the area \x01w%s\x01b.", noMessagesInSubBoardText: "\x01n\x01h\x01bThere are no messages in the area \x01w%s\x01b.",
noSearchResultsInSubBoardText: "\x01n\x01h\x01bNo messages were found in the area \x01w%s\x01b with the given search criteria.", noSearchResultsInSubBoardText: "\x01n\x01h\x01bNo messages were found in \x01w%s\x01b with the given search criteria.",
msgScanCompleteText: "\x01n\x01h\x01cM\x01n\x01cessage scan complete\x01h\x01g.\x01n", msgScanCompleteText: "\x01n\x01h\x01cM\x01n\x01cessage scan complete\x01h\x01g.\x01n",
invalidMsgNumText: "\x01n\x01y\x01hInvalid message number: %d", invalidMsgNumText: "\x01n\x01y\x01hInvalid message number: %d",
readMsgNumPromptText: "\x01n\x01g\x01h\x01i* \x01n\x01cRead message #: \x01h", readMsgNumPromptText: "\x01n\x01g\x01h\x01i* \x01n\x01cRead message #: \x01h",
...@@ -2034,7 +2038,9 @@ function DigDistMsgReader_SearchMsgScan(pSearchModeStr, pTxtToSearch, pSubCode) ...@@ -2034,7 +2038,9 @@ function DigDistMsgReader_SearchMsgScan(pSearchModeStr, pTxtToSearch, pSubCode)
console.mnemonics(bbs.text(SubGroupOrAll)); console.mnemonics(bbs.text(SubGroupOrAll));
scanScopeChar = console.getkeys("SGAC").toString(); scanScopeChar = console.getkeys("SGAC").toString();
} }
if (scanScopeChar.length > 0) if (pSubCode == "mail") // Searching personal email
this.SearchMessages(pSearchModeStr, pSubCode, null, pTxtToSearch, true); // Skip/ignore scan config checks
else if (scanScopeChar.length > 0)
this.SearchMessages(pSearchModeStr, null, scanScopeChar, pTxtToSearch, true); // Skip/ignore scan config checks this.SearchMessages(pSearchModeStr, null, scanScopeChar, pTxtToSearch, true); // Skip/ignore scan config checks
else else
{ {
...@@ -2326,7 +2332,10 @@ function DigDistMsgReader_PopulateHdrsIfSearch_DispErrorIfNoMsgs(pCloseMsgbaseAn ...@@ -2326,7 +2332,10 @@ function DigDistMsgReader_PopulateHdrsIfSearch_DispErrorIfNoMsgs(pCloseMsgbaseAn
if (this.readingPersonalEmail) if (this.readingPersonalEmail)
{ {
//console.print(replaceAtCodesInStr(this.text.noPersonalEmailText)); //console.print(replaceAtCodesInStr(this.text.noPersonalEmailText));
console.putmsg(this.text.noPersonalEmailText); if (this.searchType == SEARCH_NONE)
console.putmsg(this.text.noPersonalEmailText);
else
printf("\x01n" + this.text.noSearchResultsInSubBoardText, "Personal E-Mail");
} }
else else
{ {
...@@ -8468,7 +8477,7 @@ function DigDistMsgReader_ReadConfigFile() ...@@ -8468,7 +8477,7 @@ function DigDistMsgReader_ReadConfigFile()
// Set any text strings specified // Set any text strings specified
for (var prop in this.text) for (var prop in this.text)
{ {
if (typeof(themeSettingsObj[prop]) === "string") if (typeof(themeSettingsObj[prop]) === "string" && themeSettingsObj[prop].length > 0)
{ {
// Replace any instances of "\x01" with the Synchronet // Replace any instances of "\x01" with the Synchronet
// attribute control character // attribute control character
...@@ -17831,6 +17840,7 @@ function parseArgs(argv) ...@@ -17831,6 +17840,7 @@ function parseArgs(argv)
// keyword search and from name search. // keyword search and from name search.
if (argVals.hasOwnProperty("personalemail") && argVals.personalemail) if (argVals.hasOwnProperty("personalemail") && argVals.personalemail)
{ {
argVals.subboard = "mail";
// If a search type is specified, only allow keyword search & from name // If a search type is specified, only allow keyword search & from name
// search // search
if (argVals.hasOwnProperty("search")) if (argVals.hasOwnProperty("search"))
......
...@@ -237,7 +237,7 @@ scanningSubBoardText=\x01n\x01cScanning \x01h%s\x01n\x01c... ...@@ -237,7 +237,7 @@ scanningSubBoardText=\x01n\x01cScanning \x01h%s\x01n\x01c...
noMessagesInSubBoardText=\x01n\x01h\x01bThere are no messages in the area \x01w%s\x01b. noMessagesInSubBoardText=\x01n\x01h\x01bThere are no messages in the area \x01w%s\x01b.
; For no search results found in a sub-board. %s will be replaced with a ; For no search results found in a sub-board. %s will be replaced with a
; sub-board name. ; sub-board name.
noSearchResultsInSubBoardText=\x01n\x01h\x01bNo messages were found in the area \x01w%s\x01b with the given search criteria. noSearchResultsInSubBoardText=\x01n\x01h\x01bNo messages were found in \x01w%s\x01b with the given search criteria.
; Prompt text to input a number of a message to read ; Prompt text to input a number of a message to read
readMsgNumPromptText=\x01n\x01g\x01h\x01i* \x01n\x01cRead message #: \x01h readMsgNumPromptText=\x01n\x01g\x01h\x01i* \x01n\x01cRead message #: \x01h
; Invalid message number. %d will be replaced with the message number. ; Invalid message number. %d will be replaced with the message number.
......
Digital Distortion Message Reader Digital Distortion Message Reader
Version 1.74 Version 1.75
Release date: 2023-04-25 Release date: 2023-08-16
by by
...@@ -474,6 +474,13 @@ common message operations. ...@@ -474,6 +474,13 @@ common message operations.
- Read sent personal email: - Read sent personal email:
?../xtrn/DDMsgReader/DDMsgReader.js -personalEmailSent -startMode=read ?../xtrn/DDMsgReader/DDMsgReader.js -personalEmailSent -startMode=read
- Search personal email with a keyword, and start with the message list:
?../xtrn/DDMsgReader/DDMsgReader.js -search=keyword_search -personalEmail -startMode=list
Alternately, for searching personal email with a keyword, you can specify -subBoard=mail
instead of -personalEmail:
?../xtrn/DDMsgReader/DDMsgReader.js -search=keyword_search -subBoard=mail -startMode=list
Text customization using text.dat Text customization using text.dat
--------------------------------- ---------------------------------
......
...@@ -5,6 +5,8 @@ Revision History (change log) ...@@ -5,6 +5,8 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
1.75 2023-08-16 Made some changes to allow easy searching of personal
email with command-line arguments.
1.74 2023-04-29 Settings for users being able to read deleted messages now 1.74 2023-04-29 Settings for users being able to read deleted messages now
applies to personal email. Also, allows reading messages applies to personal email. Also, allows reading messages
that are marked for deletion in addition to just seeing that are marked for deletion in addition to just seeing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment