mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
hicli/sync: always set sorting timestamp for new rooms
This commit is contained in:
parent
948c9b0f39
commit
21eaeeaecf
2 changed files with 2 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ const (
|
|||
preview_event_rowid, sorting_timestamp, prev_batch
|
||||
FROM room
|
||||
`
|
||||
getRoomsBySortingTimestampQuery = getRoomBaseQuery + `WHERE sorting_timestamp < $1 ORDER BY sorting_timestamp DESC LIMIT $2`
|
||||
getRoomsBySortingTimestampQuery = getRoomBaseQuery + `WHERE sorting_timestamp < $1 AND sorting_timestamp > 0 ORDER BY sorting_timestamp DESC LIMIT $2`
|
||||
getRoomByIDQuery = getRoomBaseQuery + `WHERE room_id = $1`
|
||||
ensureRoomExistsQuery = `
|
||||
INSERT INTO room (room_id) VALUES ($1)
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ func (h *HiClient) processSyncJoinedRoom(ctx context.Context, roomID id.RoomID,
|
|||
if err != nil {
|
||||
return fmt.Errorf("failed to ensure room row exists: %w", err)
|
||||
}
|
||||
existingRoomData = &database.Room{ID: roomID}
|
||||
existingRoomData = &database.Room{ID: roomID, SortingTimestamp: jsontime.UnixMilliNow()}
|
||||
}
|
||||
|
||||
for _, evt := range room.AccountData.Events {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue