diff --git a/xtrn/DDMsgReader/DDMsgReader.cfg b/xtrn/DDMsgReader/DDMsgReader.cfg index 1f1cd7717845acef970d042154e37ef2cb1b6bbd..51a5c154f9bea8f362c3be4a8d7175b58ffc4292 100644 --- a/xtrn/DDMsgReader/DDMsgReader.cfg +++ b/xtrn/DDMsgReader/DDMsgReader.cfg @@ -1,22 +1,25 @@ +; Message list interface style - Valid values are Lightbar and Traditional listInterfaceStyle=Lightbar -;listInterfaceStyle=Traditional reverseListOrder=false +; Message reader interface style - Valid values are Scrollable and Traditional +; The scrollable interface only works if the user's client supports ANSI. readerInterfaceStyle=Scrollable -;readerInterfaceStyle=Traditional +; Message reader interface style for messages with ANSI content - Valid values +; are Scrollable and Traditional +; The scrollable interface only works if the user's client supports ANSI. readerInterfaceStyleForANSIMessages=Scrollable -;readerInterfaceStyleForANSIMessages=Traditional displayBoardInfoInHeader=false promptToContinueListingMessages=false promptConfirmReadMessage=false ; msgListDisplayTime specifies whether to use the import time or the written ; time in the message lists. Valid values are imported and written -msgListDisplayTime=imported +msgListDisplayTime=written ; In the message area lists (for changing to another message area), the ; date & time of the last-imported message will be shown. ; msgAreaList_lastImportedMsg_time specifies whether to use the ; import time or the written time for the last-imported message in the message ; area lists. Valid values are imported and written -msgAreaList_lastImportedMsg_time=imported +msgAreaList_lastImportedMsg_time=written ; Whether or not to start in message list mode or reader mode startMode=Reader ; The number of spaces to use for tab characters in enhanced reader mode @@ -27,7 +30,9 @@ pauseAfterNewMsgScan=true ; the user whether to post on the sub-board in reader mode after reading the ; last message instead of prompting to go to the next sub-board. This is ; like the stock Synchronet behavior. -readingPostOnSubBoardInsteadOfGoToNext=true +readingPostOnSubBoardInsteadOfGoToNext=false +; The filename (without the extension) and maximum number of lines to use for +; the header file to display above the message areas in the message chooser areaChooserHdrFilenameBase=areaChgHeader areaChooserHdrMaxLines=5 diff --git a/xtrn/DDMsgReader/DDMsgReader.js b/xtrn/DDMsgReader/DDMsgReader.js index a7cdd43d0ee177da417f873fc3f62d27c05088e1..f281a0f1bbf88bfb481e362b676a63f33f74bdf7 100644 --- a/xtrn/DDMsgReader/DDMsgReader.js +++ b/xtrn/DDMsgReader/DDMsgReader.js @@ -3961,8 +3961,19 @@ function DigDistMsgReader_PrintMessageInfo(pMsgHeader, pHighlight, pMsgNum) } else { - sDate = strftime("%Y-%m-%d", pMsgHeader.when_written_time); - sTime = strftime("%H:%M:%S", pMsgHeader.when_written_time); + //sDate = strftime("%Y-%m-%d", pMsgHeader.when_written_time); + //sTime = strftime("%H:%M:%S", pMsgHeader.when_written_time); + var msgWrittenLocalTime = msgWrittenTimeToLocalBBSTime(pMsgHeader); + if (msgWrittenLocalTime != -1) + { + sDate = strftime("%Y-%m-%d", msgWrittenLocalTime); + sTime = strftime("%H:%M:%S", msgWrittenLocalTime); + } + else + { + sDate = strftime("%Y-%m-%d", pMsgHeader.when_written_time); + sTime = strftime("%H:%M:%S", pMsgHeader.when_written_time); + } } var msgNum = (typeof(pMsgNum) == "number" ? pMsgNum : pMsgHeader.offset+1); @@ -10686,7 +10697,14 @@ function DigDistMsgReader_ListSubBoardsInMsgGroup_Traditional(pGrpIndex, pMarkIn if (this.msgAreaList_lastImportedMsg_showImportTime) subBoardInfo.newestPostDate = msgHeader.when_imported_time else - subBoardInfo.newestPostDate = msgHeader.when_written_time; + { + //subBoardInfo.newestPostDate = msgHeader.when_written_time; + var msgWrittenLocalTime = msgWrittenTimeToLocalBBSTime(msgHeader); + if (msgWrittenLocalTime != -1) + subBoardInfo.newestPostDate = msgWrittenTimeToLocalBBSTime(msgHeader); + else + subBoardInfo.newestPostDate = msgHeader.when_written_time; + } } } msgBase.close(); @@ -10776,8 +10794,19 @@ function DigDistMsgReader_ListSubBoardsInMsgGroup_Traditional(pGrpIndex, pMarkIn } else { - newestDate.date = strftime("%Y-%m-%d", msgHeader.when_written_time); - newestDate.time = strftime("%H:%M:%S", msgHeader.when_written_time); + //newestDate.date = strftime("%Y-%m-%d", msgHeader.when_written_time); + //newestDate.time = strftime("%H:%M:%S", msgHeader.when_written_time); + var msgWrittenLocalTime = msgWrittenTimeToLocalBBSTime(msgHeader); + if (msgWrittenLocalTime != -1) + { + newestDate.date = strftime("%Y-%m-%d", msgWrittenLocalTime); + newestDate.time = strftime("%H:%M:%S", msgWrittenLocalTime); + } + else + { + newestDate.date = strftime("%Y-%m-%d", msgHeader.when_written_time); + newestDate.time = strftime("%H:%M:%S", msgHeader.when_written_time); + } } } else @@ -11055,8 +11084,19 @@ function DigDistMsgReader_WriteMsgSubBrdLine(pGrpIndex, pSubIndex, pHighlight) } else { - newestDate.date = strftime("%Y-%m-%d", msgHeader.when_written_time); - newestDate.time = strftime("%H:%M:%S", msgHeader.when_written_time); + //newestDate.date = strftime("%Y-%m-%d", msgHeader.when_written_time); + //newestDate.time = strftime("%H:%M:%S", msgHeader.when_written_time); + var msgWrittenLocalTime = msgWrittenTimeToLocalBBSTime(msgHeader); + if (msgWrittenLocalTime != -1) + { + newestDate.date = strftime("%Y-%m-%d", msgWrittenLocalTime); + newestDate.time = strftime("%H:%M:%S", msgWrittenLocalTime); + } + else + { + newestDate.date = strftime("%Y-%m-%d", msgHeader.when_written_time); + newestDate.time = strftime("%H:%M:%S", msgHeader.when_written_time); + } } } else @@ -16480,6 +16520,26 @@ function getStrAfterPeriod(pStr) return strAfterPeriod; } +// Adjusts a message's when-written time to the BBS's local time. +// +// Parameters: +// pMsgHdr: A message header object +// +// Return value: The message's when_written_time adjusted to the BBS's local time. +// If the message header doesn't have a when_written_time or +// when_written_zone property, then this function will return -1. +function msgWrittenTimeToLocalBBSTime(pMsgHdr) +{ + if (!pMsgHdr.hasOwnProperty("when_written_time") || !pMsgHdr.hasOwnProperty("when_written_zone")) + return -1; + + var timeZoneDiffMinutes = msgHeader.when_imported_zone_offset - msgHeader.when_written_zone_offset; + //var timeZoneDiffMinutes = pMsgHdr.when_written_zone - system.timezone; + var timeZoneDiffSeconds = timeZoneDiffMinutes * 60; + var msgWrittenTimeAdjusted = pMsgHdr.when_written_time + timeZoneDiffSeconds; + return msgWrittenTimeAdjusted; +} + ///////////////////////////////////////////////////////////////////////// // Debug helper & error output function