Package-level declarations

Types

Link copied to clipboard
class DirectRoomEventHandler(userInfo: UserInfo, api: MatrixClientServerApiClient, roomStore: RoomStore, roomStateStore: RoomStateStore, globalAccountDataStore: GlobalAccountDataStore) : EventHandler
Link copied to clipboard
data class GetTimelineEventConfig(var decryptionTimeout: Duration = INFINITE, var fetchTimeout: Duration = INFINITE, var fetchSize: Long = 20, var allowReplaceContent: Boolean = true)
Link copied to clipboard
data class GetTimelineEventsConfig(var decryptionTimeout: Duration = INFINITE, var fetchTimeout: Duration = INFINITE, var fetchSize: Long = 20, var allowReplaceContent: Boolean = true, var minSize: Long? = null, var maxSize: Long? = null)
Link copied to clipboard
class MegolmRoomEventDecryptionService(olmCryptoStore: OlmCryptoStore, keyBackupService: KeyBackupService, outgoingRoomKeyRequestEventHandler: OutgoingRoomKeyRequestEventHandler, olmEncryptionService: OlmEncryptionService) : RoomEventDecryptionService
Link copied to clipboard
class OutboxMessageEventHandler(config: MatrixClientConfiguration, api: MatrixClientServerApiClient, possiblyEncryptEvent: PossiblyEncryptEvent, mediaService: MediaService, roomOutboxMessageStore: RoomOutboxMessageStore, outboxMessageMediaUploaderMappings: OutboxMessageMediaUploaderMappings, currentSyncState: CurrentSyncState, tm: RepositoryTransactionManager) : EventHandler
Link copied to clipboard
class RoomAccountDataEventHandler(api: MatrixClientServerApiClient, roomAccountDataStore: RoomAccountDataStore, tm: RepositoryTransactionManager) : EventHandler
Link copied to clipboard
class RoomAvatarUrlEventHandler(userInfo: UserInfo, api: MatrixClientServerApiClient, roomStore: RoomStore, roomStateStore: RoomStateStore, globalAccountDataStore: GlobalAccountDataStore, tm: RepositoryTransactionManager) : EventHandler
Link copied to clipboard
class RoomDisplayNameEventHandler(api: MatrixClientServerApiClient, roomStore: RoomStore, roomStateStore: RoomStateStore) : EventHandler
Link copied to clipboard
class RoomEncryptionEventHandler(api: MatrixClientServerApiClient, roomStore: RoomStore, tm: RepositoryTransactionManager) : EventHandler
Link copied to clipboard
Link copied to clipboard
class RoomListHandler(api: MatrixClientServerApiClient, roomStore: RoomStore, roomService: RoomService, tm: RepositoryTransactionManager, config: MatrixClientConfiguration) : EventHandler
Link copied to clipboard
interface RoomService
Link copied to clipboard
class RoomServiceImpl(api: MatrixClientServerApiClient, roomStore: RoomStore, roomUserStore: RoomUserStore, roomStateStore: RoomStateStore, roomAccountDataStore: RoomAccountDataStore, roomTimelineStore: RoomTimelineStore, roomOutboxMessageStore: RoomOutboxMessageStore, roomEventDecryptionServices: List<RoomEventDecryptionService>, mediaService: MediaService, userInfo: UserInfo, timelineEventHandler: TimelineEventHandler, typingEventHandler: TypingEventHandler, currentSyncState: CurrentSyncState, scope: CoroutineScope) : RoomService
Link copied to clipboard
class RoomStateEventHandler(api: MatrixClientServerApiClient, roomStateStore: RoomStateStore, tm: RepositoryTransactionManager) : EventHandler, LazyMemberEventHandler
Link copied to clipboard
class RoomUpgradeHandler(api: MatrixClientServerApiClient, roomStore: RoomStore, configuration: MatrixClientConfiguration) : EventHandler
Link copied to clipboard
Link copied to clipboard
interface Timeline<T>

This is an abstraction for a timeline. Call init first!

Link copied to clipboard
abstract class TimelineBase<T>(val transformer: suspend (Flow<TimelineEvent>) -> T) : Timeline<T>

An implementation for some restrictions required by Timeline.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class TimelineEventHandlerImpl(api: MatrixClientServerApiClient, roomStore: RoomStore, roomTimelineStore: RoomTimelineStore, roomOutboxMessageStore: RoomOutboxMessageStore, timelineMutex: TimelineMutex, tm: RepositoryTransactionManager) : EventHandler, TimelineEventHandler
Link copied to clipboard
class TimelineImpl<T>(roomId: RoomId, roomService: RoomService, transformer: suspend (Flow<TimelineEvent>) -> T) : TimelineBase<T>
Link copied to clipboard
Link copied to clipboard
data class TimelineState<T>(val elements: List<T> = listOf(), val lastLoadedEventIdBefore: EventId? = null, val lastLoadedEventIdAfter: EventId? = null, val isInitialized: Boolean = false, val isLoadingBefore: Boolean = false, val isLoadingAfter: Boolean = false, val canLoadBefore: Boolean = false, val canLoadAfter: Boolean = false)
Link copied to clipboard
data class TimelineStateChange<T>(val elementsBeforeChange: List<T> = listOf(), val elementsAfterChange: List<T> = listOf(), val newElements: List<T> = listOf())
Link copied to clipboard
class TypingEventHandler(api: MatrixClientServerApiClient) : EventHandler

Functions

Link copied to clipboard
fun createRoomModule(): Module
Link copied to clipboard
Link copied to clipboard
fun StateFlow<Map<RoomId, StateFlow<Room?>>>.flatten(throttle: Duration = 200.milliseconds, filterUpgradedRooms: Boolean = true): Flow<Set<Room>>

This collects all rooms, so when one room changes, a new room set gets emitted. A change of the outer flow results in new collect of the inner flows. Because this is an expensive operation, the outer flow is throttled by default.

Link copied to clipboard
inline fun <C : RoomAccountDataEventContent> RoomService.getAccountData(roomId: RoomId, key: String = ""): Flow<C?>
Link copied to clipboard
inline fun <C : StateEventContent> RoomService.getAllState(roomId: RoomId): Flow<Map<String, Flow<Event<C>?>>?>
Link copied to clipboard
inline fun <C : StateEventContent> RoomService.getState(roomId: RoomId, stateKey: String = ""): Flow<Event<C>?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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.

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.

Link copied to clipboard
@JvmName(name = "toListFromLatest")
fun Flow<Flow<Flow<TimelineEvent>>?>.toFlowList(maxSize: StateFlow<Int>, minSize: MutableStateFlow<Int> = MutableStateFlow(0)): Flow<List<Flow<TimelineEvent>>>

Converts a flow of flow of timeline events into a flow of list of timeline events limited by maxSize.

@JvmName(name = "toList")
fun Flow<Flow<TimelineEvent>>.toFlowList(maxSize: StateFlow<Int>, minSize: MutableStateFlow<Int> = MutableStateFlow(0)): Flow<List<Flow<TimelineEvent>>>

Converts a flow of timeline events into a flow of list of timeline events limited by maxSize.