diff options
-rw-r--r-- | irc/states.go | 2 | ||||
-rw-r--r-- | irc/tokens.go | 2 | ||||
-rw-r--r-- | ui/buffers.go | 8 |
3 files changed, 5 insertions, 7 deletions
diff --git a/irc/states.go b/irc/states.go index b335b26..8837018 100644 --- a/irc/states.go +++ b/irc/states.go @@ -361,7 +361,7 @@ func (s *Session) requestHistory(act actionRequestHistory) (err error) { } t := act.Before - 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) + 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) return } diff --git a/irc/tokens.go b/irc/tokens.go index 8a89a47..57fd266 100644 --- a/irc/tokens.go +++ b/irc/tokens.go @@ -306,8 +306,6 @@ func (msg *Message) Time() (t time.Time, ok bool) { } t = time.Date(year, time.Month(month), day, hour, minute, second, millis*1e6, time.UTC) - t = t.Local() - return } diff --git a/ui/buffers.go b/ui/buffers.go index f3605a6..c1426f9 100644 --- a/ui/buffers.go +++ b/ui/buffers.go @@ -230,7 +230,7 @@ func (b *buffer) DrawLines(screen tcell.Screen, width, height, nickColWidth int) } if i == 0 || b.lines[i-1].at.Truncate(time.Minute) != line.at.Truncate(time.Minute) { - printTime(screen, 0, y0, st.Bold(true), line.at) + printTime(screen, 0, y0, st.Bold(true), line.at.Local()) } head := truncate(line.head, nickColWidth, "\u2026") @@ -383,9 +383,9 @@ func (bs *bufferList) AddLines(title string, lines []Line) { limit := len(lines) if 0 < len(b.lines) { - firstLineTime := b.lines[0].at.Round(time.Millisecond) - for i := len(lines) - 1; 0 <= i; i-- { - if firstLineTime == lines[i].at.Round(time.Millisecond) { + firstLineTime := b.lines[0].at.Unix() + for i, l := range lines { + if firstLineTime < l.at.Unix() { limit = i break } |