Fix last cached message not showing up when loading history

This commit is contained in:
Tulir Asokan 2019-04-10 02:25:22 +03:00
parent 005c51c3b5
commit b668c2cdc7

View File

@ -185,7 +185,7 @@ func (hm *HistoryManager) Load(room *rooms.Room, num int) (events []*mautrix.Eve
}
ptrStart, ok := hm.historyLoadPtr[room]
if !ok {
ptrStart = stream.Sequence()
ptrStart = stream.Sequence() + 1
}
c := stream.Cursor()
k, v := c.Seek(itob(ptrStart - uint64(num)))