~taiite/public-inbox

[PATCH senpai] Fix app.lastCloseTime

Details
Message ID
<376c4467c3437337be357bc4ce8ae462@riseup.net>
DKIM signature
missing
Download raw message
From 0bd3b5c7966b136f5734d99f88acbd4c7af42e59 Mon Sep 17 00:00:00 2001
From: the-y <the-y@riseup.net>
Date: Sat, 18 Feb 2023 03:10:09 +0100
Subject: [PATCH] Set app.lastMessageTime only ever to msg.time(), never
to
 time.now() as the system time may not be correct/synced with the
server. As
 senpai uses lastMessageTime to later retrieve the lastCloseTime, this
also
 fixes sending CHATHISTORY TARGETS with the wrong time

---
 app.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app.go b/app.go
index f65ec4c..6dc0da1 100644
--- a/app.go
+++ b/app.go
@@ -731,8 +731,8 @@ func (app *App) handleIRCEvent(netID string, ev
interface{}) {
                })
                return
        }
-       t := msg.TimeOrNow()
-       if t.After(app.lastMessageTime) {
+       t, ok := msg.Time()
+       if ok && t.After(app.lastMessageTime) {
                app.lastMessageTime = t
        }
 
-- 
2.39.2
Reply to thread Export thread (mbox)