Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
56e42869
Commit
56e42869
authored
1 year ago
by
Eric Oulashin
Committed by
Rob Swindell
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
DDMsgReader: Bug fix for deleting multiple selected messages
parent
c0fbb7be
No related branches found
No related tags found
2 merge requests
!463
MRC mods by Codefenix (2024-10-20)
,
!271
DDMsgReader: Bug fix for deleting multiple selected messages
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
xtrn/DDMsgReader/DDMsgReader.js
+27
-12
27 additions, 12 deletions
xtrn/DDMsgReader/DDMsgReader.js
xtrn/DDMsgReader/readme.txt
+2
-2
2 additions, 2 deletions
xtrn/DDMsgReader/readme.txt
xtrn/DDMsgReader/revision_history.txt
+5
-0
5 additions, 0 deletions
xtrn/DDMsgReader/revision_history.txt
with
34 additions
and
14 deletions
xtrn/DDMsgReader/DDMsgReader.js
+
27
−
12
View file @
56e42869
...
...
@@ -108,6 +108,10 @@
* so that screen updates work better after pausing output.
* Also, when running a new message scan (not new-to-you), the current
* sub-board being scanned is now outputted.
* 2023-03-24 Eric Oulashin Version 1.69
* Bug fix for deleting multiple selected messages: When updating message
* headers in the cached arrays, don't try to save them back to the database,
* because that was already done (this avoids a 'header has expanded fields' error).
*/
"use strict";
...
...
@@ -213,8 +217,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a');
// Reader version information
var READER_VERSION = "1.6
8
";
var READER_DATE = "2023-03-
15
";
var READER_VERSION = "1.6
9
";
var READER_DATE = "2023-03-
24
";
// Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24);
...
...
@@ -1686,15 +1690,20 @@ function msgNumToIdxFromMsgbase(pSubCode, pMsgNum)
// pApply: Optional boolean - Whether or not to apply the attribute or remove it. Defaults to true.
// pSubBoardCode: Optional - An internal sub-board code. If not specified, then
// this method will default to this.subBoardCode.
function DigDistMsgReader_RefreshSearchResultMsgHdr(pMsgIndex, pAttrib, pApply, pSubBoardCode)
// pWriteHdrToMsgbase: Optional boolean - Whether or not to also save the message to the messagebase. Defaults to true.
function DigDistMsgReader_RefreshSearchResultMsgHdr(pMsgIndex, pAttrib, pApply, pSubBoardCode, pWriteHdrToMsgbase)
{
if (typeof(pMsgIndex) != "number")
return;
var applyAttr = (typeof(pApply) === "boolean" ? pApply : true);
var subCode = (typeof(pSubBoardCode) == "string" ? pSubBoardCode : this.subBoardCode);
var subCode = (typeof(pSubBoardCode) === "string" ? pSubBoardCode : this.subBoardCode);
var writeHdrToMsgbase = (typeof(pWriteHdrToMsgbase) === "boolean" ? pWriteHdrToMsgbase : true);
var msgbase = new MsgBase(subCode);
if (msgbase.open())
var continueOn = true;
if (writeHdrToMsgbase)
continueOn = msgbase.open();
if (continueOn)
{
if (this.msgSearchHdrs.hasOwnProperty(subCode))
{
...
...
@@ -1707,8 +1716,11 @@ function DigDistMsgReader_RefreshSearchResultMsgHdr(pMsgIndex, pAttrib, pApply,
this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex].attr = this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex].attr | pAttrib;
else
this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex].attr = this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex].attr ^ pAttrib;
var msgOffsetFromHdr = this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex].offset;
msgbase.put_msg_header(true, msgOffsetFromHdr, this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex]);
if (writeHdrToMsgbase)
{
var msgOffsetFromHdr = this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex].offset;
msgbase.put_msg_header(true, msgOffsetFromHdr, this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex]);
}
}
}
else
...
...
@@ -1717,11 +1729,13 @@ function DigDistMsgReader_RefreshSearchResultMsgHdr(pMsgIndex, pAttrib, pApply,
if (this.msgSearchHdrs[this.subBoardCode].indexed.hasOwnProperty(pMsgIndex))
{
this.msgSearchHdrs[this.subBoardCode].indexed[pMsgIndex] = msgHeader;
msgbase.put_msg_header(true, msgHeader.offset, msgHeader);
if (writeHdrToMsgbase)
msgbase.put_msg_header(true, msgHeader.offset, msgHeader);
}
}
}
msgbase.close();
if (writeHdrToMsgbase)
msgbase.close();
}
}
...
...
@@ -1758,10 +1772,11 @@ function DigDistMsgReader_RefreshHdrInSubBoardHdrs(pMsgIndex, pAttrib, pApply)
// pApply: Optional boolean - Whether or not to apply the attribute or remove it. Defaults to true.
// pSubBoardCode: Optional - An internal sub-board code. If not specified, then
// this method will default to this.subBoardCode.
function DigDistMsgReader_RefreshHdrInSavedArrays(pMsgIndex, pAttrib, pApply, pSubBoardCode)
// pWriteHdrToMsgbase: Optional boolean - Whether or not to also save the message to the messagebase. Defaults to true.
function DigDistMsgReader_RefreshHdrInSavedArrays(pMsgIndex, pAttrib, pApply, pSubBoardCode, pWriteHdrToMsgbase)
{
var applyAttr = (typeof(pApply) === "boolean" ? pApply : true);
this.RefreshSearchResultMsgHdr(pMsgIndex, pAttrib, applyAttr, pSubBoardCode);
this.RefreshSearchResultMsgHdr(pMsgIndex, pAttrib, applyAttr, pSubBoardCode
, pWriteHdrToMsgbase
);
this.RefreshHdrInSubBoardHdrs(pMsgIndex, pAttrib, applyAttr);
}
...
...
@@ -14317,7 +14332,7 @@ function DigDistMsgReader_DeleteOrUndeleteSelectedMessages(pDelete)
// Refresh the message header in the header arrays (if it exists there) and
// remove the message index from the selectedMessages object. Also, delete
// or undelete any vote response messages that may exist for this message.
this.RefreshHdrInSavedArrays(msgIdxNumber, MSG_DELETE, markAsDeleted, subBoardCode);
this.RefreshHdrInSavedArrays(msgIdxNumber, MSG_DELETE, markAsDeleted, subBoardCode
, false
);
var voteDelRetObj = toggleVoteMsgsDeleted(msgBase, msgHdr.number, msgHdr.id, markAsDeleted, (subBoardCode == "mail"));
if (!voteDelRetObj.allVoteMsgsAffected)
{
...
...
This diff is collapsed.
Click to expand it.
xtrn/DDMsgReader/readme.txt
+
2
−
2
View file @
56e42869
Digital Distortion Message Reader
Version 1.6
8
Release date: 2023-03-
15
Version 1.6
9
Release date: 2023-03-
24
by
...
...
This diff is collapsed.
Click to expand it.
xtrn/DDMsgReader/revision_history.txt
+
5
−
0
View file @
56e42869
...
...
@@ -5,6 +5,11 @@ Revision History (change log)
=============================
Version Date Description
------- ---- -----------
1.69 2023-03-24 Bug fix for deleting multiple selected messages: When
updating message headers in the cached arrays, don't try
to save them back to the database, because that was
already done (this avoids a 'header has expanded fields'
error).
1.68 2023-03-15 Makes use of console.aborted when displaying help screens
so that screen updates work better after pausing output.
Also, when running a new message scan (not new-to-you),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment