Skip to content
Snippets Groups Projects
Commit c5975719 authored by Eric Oulashin's avatar Eric Oulashin Committed by Rob Swindell
Browse files

DDMsgReader bug fix: Ensure header lines are not too long for the user's...

DDMsgReader bug fix: Ensure header lines are not too long for the user's terminal. Should fix issue #550
parent 9b63c54f
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!286DDMsgReader bug fix: Ensure header lines are not too long for the user's terminal. Should fix issue #550
......@@ -124,6 +124,10 @@
* Added a quick-validation hotkey, Ctrl-Q, for sysops to use to apply a
* quick-validation set to a user when reading their message. Quick-Validation
* sets are configured in SCFG > System > Security Options > Quick-Validation Values.
* 2023-04-17 Eric Oulashin Version 1.73
* Bug fix: When getting header lines to view, ensure the header lines
* are not too wide for the user's terminal. Header lines that are too
* long will be split into no more than 2 lines.
*/
 
"use strict";
......@@ -229,8 +233,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a');
 
 
// Reader version information
var READER_VERSION = "1.72";
var READER_DATE = "2023-04-16";
var READER_VERSION = "1.73";
var READER_DATE = "2023-04-17";
 
// Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24);
......@@ -12862,6 +12866,25 @@ function DigDistMsgReader_GetExtdMsgHdrInfo(pMsgHdr, pKludgeOnly)
msgHdrInfoLines.pop();
}
 
// Make sure the header lines aren't too long for the user's terminal.
// Leave a column for the scrollbar.
// Note: substrWithAttrCodes(pStr, pStartIdx, pLen) is defined in dd_lightbar_menu.js
for (var i = 0; i < msgHdrInfoLines.length; ++i)
{
var maxLen = console.screen_columns - 1;
var strLen = console.strlen(msgHdrInfoLines[i]);
if (console.strlen(msgHdrInfoLines[i]) > maxLen)
{
// This assumes the line will probably not span more than 2 lines after
// being split
var line1 = substrWithAttrCodes(msgHdrInfoLines[i], 0, maxLen);
var line2 = substrWithAttrCodes(msgHdrInfoLines[i], maxLen, maxLen);
msgHdrInfoLines[i] = line1;
msgHdrInfoLines.splice(i+1, 0, line2);
++i;
}
}
return msgHdrInfoLines;
}
 
......
Digital Distortion Message Reader
Version 1.72
Release date: 2023-04-16
Version 1.73
Release date: 2023-04-17
by
......@@ -1209,6 +1209,10 @@ Alternately, quickUserValSetIndex can be set to something invalid (like -1) for
DDMsgReader to display a menu of the quick-validation sets to let you choose
one.
DDMsgReader applies the flag sets, exemptions, and restrictions to a user in
addition to any that the user might already have, so that any that you have
added for a user will be preserved (DDMsgReader does a bitwise 'or').
A quick-validation set in CFG is a set that includes a security level, flag
sets, exemptions, restrictions, and additional credits. For example:
......
......@@ -5,6 +5,10 @@ Revision History (change log)
=============================
Version Date Description
------- ---- -----------
1.73 2023-04-17 Bug fix: When getting header lines to view, ensure the
header lines are not too wide for the user's terminal.
Header lines that are too long will be split into no more
than 2 lines.
1.72 2023-04-16 Added a quick-validation hotkey, Ctrl-Q, for sysops to
use to apply a quick-validation set to a user when
reading their message. Quick-Validation sets are
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment