diff options
author | delthas <delthas@dille.cc> | 2022-10-17 14:17:05 +0200 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-10-17 14:17:05 +0200 |
commit | ec480412c4b4460625a7dc304ec0a63d0619913a (patch) | |
tree | 7e40124dff1ab555cbbb774a3f301df5fd69c96c /irc/session.go | |
parent | Fix OSC 8 hyperlink ID format (diff) |
Fix requesting CHATHISTORY TARGETS with invalid timestamps
Previously, we sent the CHATHISTORY TARGETS start time with an incorrect
offset equal to the system time offset.
This means that we only reopened private buffers from the last app close
+ N hours on a system with a N-hour time offset.
This fixes the issue by saving the stamp as UTC, and also making sure to
format any time offset correctly.
Diffstat (limited to 'irc/session.go')
-rw-r--r-- | irc/session.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/irc/session.go b/irc/session.go index 63de30f..f4b3dfd 100644 --- a/irc/session.go +++ b/irc/session.go @@ -514,6 +514,7 @@ type HistoryRequest struct { } func formatTimestamp(t time.Time) string { + t = t.UTC() return fmt.Sprintf("timestamp=%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond()/1e6) } |