RoomService

interface RoomService

Functions

Link copied to clipboard
abstract suspend fun abortSendMessage(transactionId: String)
Link copied to clipboard
abstract fun canBeRedacted(timelineEvent: TimelineEvent): Flow<Boolean>
Link copied to clipboard
abstract suspend fun fillTimelineGaps(startEventId: EventId, roomId: RoomId, limit: Long = 20)
Link copied to clipboard
abstract fun <C : RoomAccountDataEventContent> getAccountData(roomId: RoomId, eventContentClass: KClass<C>, key: String = ""): Flow<C?>
Link copied to clipboard
abstract fun getAll(): StateFlow<Map<RoomId, StateFlow<Room?>>>
Link copied to clipboard
abstract fun <C : StateEventContent> getAllState(roomId: RoomId, eventContentClass: KClass<C>): Flow<Map<String, Event<C>?>?>
Link copied to clipboard
abstract fun getById(roomId: RoomId): Flow<Room?>
Link copied to clipboard
abstract fun getLastTimelineEvent(roomId: RoomId, decryptionTimeout: Duration = INFINITE): Flow<Flow<TimelineEvent?>?>
Link copied to clipboard
abstract fun getLastTimelineEvents(roomId: RoomId, decryptionTimeout: Duration = INFINITE, fetchTimeout: Duration = 1.minutes, limitPerFetch: Long = 20): Flow<Flow<Flow<TimelineEvent?>>?>

Returns the last timeline events as flow.

Link copied to clipboard
abstract fun getNextTimelineEvent(event: TimelineEvent, decryptionTimeout: Duration = INFINITE, fetchTimeout: Duration = 1.minutes, limitPerFetch: Long = 20): Flow<TimelineEvent?>?
Link copied to clipboard
abstract fun getOutbox(): StateFlow<List<RoomOutboxMessage<*>>>
Link copied to clipboard
abstract fun getPreviousTimelineEvent(event: TimelineEvent, decryptionTimeout: Duration = INFINITE, fetchTimeout: Duration = 1.minutes, limitPerFetch: Long = 20): Flow<TimelineEvent?>?
Link copied to clipboard
abstract fun <C : StateEventContent> getState(roomId: RoomId, stateKey: String = "", eventContentClass: KClass<C>): Flow<Event<C>?>
Link copied to clipboard
abstract fun getTimelineEvent(eventId: EventId, roomId: RoomId, decryptionTimeout: Duration = INFINITE, fetchTimeout: Duration = 1.minutes, limitPerFetch: Long = 20): Flow<TimelineEvent?>

Returns the TimelineEvent and starts decryption with the given CoroutineScope. If it is not found locally, it is tried to find it by filling the sync-gaps.

Link copied to clipboard
abstract fun getTimelineEventRelations(eventId: EventId, roomId: RoomId): Flow<Map<RelationType, Set<TimelineEventRelation>?>?>
abstract fun getTimelineEventRelations(eventId: EventId, roomId: RoomId, relationType: RelationType): Flow<Set<TimelineEventRelation>?>
Link copied to clipboard
abstract fun getTimelineEvents(startFrom: EventId, roomId: RoomId, direction: GetEvents.Direction = BACKWARDS, decryptionTimeout: Duration = INFINITE, fetchTimeout: Duration = 1.minutes, limitPerFetch: Long = 20): Flow<Flow<TimelineEvent?>>

Returns a flow of timeline events wrapped in a flow, which emits, when there is a new timeline event at the end of the timeline.

Link copied to clipboard
abstract fun getTimelineEventsAround(startFrom: EventId, roomId: RoomId, maxSizeBefore: StateFlow<Int>, maxSizeAfter: StateFlow<Int>, decryptionTimeout: Duration = INFINITE, fetchTimeout: Duration = 1.minutes, limitPerFetch: Long = 20): Flow<List<Flow<TimelineEvent?>>>

Returns all timeline events around a starting event. This also triggers decryption for each timeline event.

Link copied to clipboard
abstract fun getTimelineEventsFromNowOn(decryptionTimeout: Duration = 30.seconds, syncResponseBufferSize: Int = 10): Flow<TimelineEvent>

Returns all timeline events from the moment this method is called. This also triggers decryption for each timeline event.

Link copied to clipboard
abstract suspend fun retrySendMessage(transactionId: String)
Link copied to clipboard
abstract suspend fun sendMessage(roomId: RoomId, keepMediaInCache: Boolean = true, builder: suspend MessageBuilder.() -> Unit)

Inheritors

Link copied to clipboard

Extensions

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