Skip to content
Snippets Groups Projects
Commit 4f291f94 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Merge branch 'dd_msg_reader_standard_hdr_utf8_and_lightbar_menu_file' into 'master'

DDMsgReader: UTF8 update for the standard Synchronet message header too.  Also, oops, dd_msg_reader.js should only be in exec/load, not xtrn/DDMsgReader.

See merge request !396
parents ece8761f 30ee222b
No related branches found
No related tags found
1 merge request!396DDMsgReader: UTF8 update for the standard Synchronet message header too. Also, oops, dd_msg_reader.js should only be in exec/load, not xtrn/DDMsgReader.
Pipeline #5574 passed
......@@ -170,6 +170,11 @@ lbMenu.wrapNavigation = false;
// long as it's not a space. For instance, to highlight the "x" in "Exit":
lbMenu.Add("E&xit", -1);
// The last parameter to Add() is a boolean specifying whether the item text is
// in UTF-8 format.
// Adding an item where the text is known to be in UTF-8 format
lbMenu.Add(someonesName, 1, null, true, true);
To enable borders, set the borderEnabled property to true. Example:
lbMenu.borderEnabled = true;
......@@ -242,6 +247,10 @@ lbMenu.GetItem = function(pItemIndex) {
// the return value to return from the menu:
menuItemObj.text = itemText;
menuItemObj.retval = itemRetval;
// And if the text in the item is UTF-8, you must specify so as follows:
menuItemObj.textIsUTF8 = true;
return menuItemObj; // The DDLightbarMenu object will use this when displaying the menu
};
......
......@@ -9838,7 +9838,13 @@ function DigDistMsgReader_DisplaySyncMsgHeader(pMsgHdr)
// message read prompt, this script now has to parse & replace some of
// the @-codes in the message header line, since Synchronet doesn't know
// that the user is reading a message.
console.putmsg(this.ParseMsgAtCodes(fileLine, pMsgHdr, null, dateTimeStr, false, true), printMode);
var hdrLine = this.ParseMsgAtCodes(fileLine, pMsgHdr, null, dateTimeStr, false, true);
// If the message is in UTF-8 and the user's terminal supports UTF-8, then we'll be printing
// with the P_UTF8 mode bit. We'll need to convert the display header line to UTF-8 so all
// of it will display properly.
if (hdrIsUTF8 && terminalSupportsUTF8)
hdrLine = utf8_encode(hdrLine);
console.putmsg(hdrLine, printMode);
console.crlf();
}
msgHdrFile.close();
......
This diff is collapsed.
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