diff options
author | Hubert Hirtz <hubert@hirtz.pm> | 2021-01-06 09:29:17 +0100 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-01-06 09:29:17 +0100 |
commit | be78c42e380634da29a4bb0d9839d5c97b83ad19 (patch) | |
tree | b354a7084d8ea906478b67ea26fa8977f7f1b3d1 /irc | |
parent | Show connection failure reason (diff) |
Chathistory: don't send invalid timestamps
Diffstat (limited to 'irc')
-rw-r--r-- | irc/states.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/irc/states.go b/irc/states.go index 3707b44..87c2a06 100644 --- a/irc/states.go +++ b/irc/states.go @@ -445,8 +445,8 @@ func (s *Session) requestHistory(act actionRequestHistory) (err error) { return } - t := act.Before.UTC() - err = s.send("CHATHISTORY BEFORE %s timestamp=%04d-%02d-%02dT%02d:%02d:%02d.%03dZ 100\r\n", act.Target, t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second()+1, t.Nanosecond()/1e6) + t := act.Before.UTC().Add(1 * time.Second) + err = s.send("CHATHISTORY BEFORE %s timestamp=%04d-%02d-%02dT%02d:%02d:%02d.%03dZ 100\r\n", act.Target, t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond()/1e6) return } |