From 0223fdffc5404f2a03b180ad401b1aa44de6fc08 Mon Sep 17 00:00:00 2001 From: RebeccaNod1 Date: Fri, 8 May 2026 19:29:12 -0600 Subject: [PATCH] Implement millisecond timestamps for chat history --- SecondBotEvents/Services/DataStoreService.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SecondBotEvents/Services/DataStoreService.cs b/SecondBotEvents/Services/DataStoreService.cs index 3932113..d4673b3 100644 --- a/SecondBotEvents/Services/DataStoreService.cs +++ b/SecondBotEvents/Services/DataStoreService.cs @@ -547,7 +547,8 @@ namespace SecondBotEvents.Services { lock (localChatHistory) { - localChatHistory.Add("{BOT} " + typeTag + GetClient().Self.Name + ": " + message); + long ms = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + localChatHistory.Add("[" + ms + "] {BOT} " + typeTag + GetClient().Self.Name + ": " + message); if (localChatHistory.Count <= myConfig.GetLocalChatHistoryLimit()) { return; @@ -564,7 +565,8 @@ namespace SecondBotEvents.Services { return; // chat window not open unable to record message } - chatWindows[sessionID].Add(fromname + ": " + message); + long ms = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + chatWindows[sessionID].Add("[" + ms + "] " + fromname + ": " + message); chatWindowsUnread[sessionID] = true; int purgeLen = myConfig.GetImChatHistoryLimit(); if (chatWindowsIsGroup[sessionID] == true) @@ -1351,7 +1353,8 @@ namespace SecondBotEvents.Services AddAvatar(e.SourceID, e.FromName); } - localChatHistory.Add(source + " " + typeTag + e.FromName + ": " + e.Message); + long ms = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + localChatHistory.Add("[" + ms + "] " + source + " " + typeTag + e.FromName + ": " + e.Message); if (localChatHistory.Count <= myConfig.GetLocalChatHistoryLimit()) { break;