Skip to content
Snippets Groups Projects
Commit daa66061 authored by nightfox's avatar nightfox
Browse files

Updated so that when using message written times in the message list & area...

Updated so that when using message written times in the message list & area chooser, the message written time will be adjusted to local BBS time so that they're all in the same time zone.  Also, changed the default options for msgAreaList_lastImportedMsg_time and msgListDisplayTime in the configuration file to written instead of imported.
parent 35dbc32f
No related branches found
No related tags found
No related merge requests found
; 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
......
......@@ -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
 
......
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