Improve init thread query

This commit is contained in:
ariskotsomitopoulos 2021-12-17 01:25:50 +02:00
parent 5723465106
commit cc7e3ea78c

View file

@ -173,9 +173,11 @@ internal class DefaultTimeline(
TimelineEventEntity TimelineEventEntity
.whereRoomId(realm, roomId = roomId) .whereRoomId(realm, roomId = roomId)
.equalTo(TimelineEventEntityFields.CHUNK.IS_LAST_FORWARD, true) .equalTo(TimelineEventEntityFields.CHUNK.IS_LAST_FORWARD, true)
.beginGroup()
.equalTo(TimelineEventEntityFields.ROOT.ROOT_THREAD_EVENT_ID, it) .equalTo(TimelineEventEntityFields.ROOT.ROOT_THREAD_EVENT_ID, it)
.or() .or()
.equalTo(TimelineEventEntityFields.ROOT.EVENT_ID, it) .equalTo(TimelineEventEntityFields.ROOT.EVENT_ID, it)
.endGroup()
.sort(TimelineEventEntityFields.DISPLAY_INDEX, Sort.DESCENDING) .sort(TimelineEventEntityFields.DISPLAY_INDEX, Sort.DESCENDING)
.findAll() .findAll()