getTimelineEventsAround

fun RoomService.getTimelineEventsAround(roomId: RoomId, startFrom: EventId, maxSizeBefore: StateFlow<Int>, maxSizeAfter: StateFlow<Int>, configStart: GetTimelineEventConfig.() -> Unit = {}, configBefore: GetTimelineEventsConfig.() -> Unit = {}, configAfter: GetTimelineEventsConfig.() -> Unit = {}): Flow<List<Flow<TimelineEvent>>>

Returns all timeline events around a starting event sorted with higher indexes being more recent.

The size of the returned list can be expanded in 2 directions: before and after the start element.

Parameters

startFrom

the start event id

maxSizeBefore

how many events to possibly get before the start event

maxSizeAfter

how many events to possibly get after the start event

configStart

The config for getting the startFrom.

configBefore

The config for getting TimelineEvents before startFrom.

configAfter

The config for getting TimelineEvents after startFrom.


suspend fun RoomService.getTimelineEventsAround(roomId: RoomId, startFrom: EventId, configStart: GetTimelineEventConfig.() -> Unit = {}, configBefore: GetTimelineEventsConfig.() -> Unit = {}, configAfter: GetTimelineEventsConfig.() -> Unit = {}): List<Flow<TimelineEvent>>

Returns all timeline events around a starting event.

Parameters

configStart

The config for getting the startFrom.

configBefore

The config for getting TimelineEvents before startFrom.

configAfter

The config for getting TimelineEvents after startFrom.

See also