MatrixClientConfiguration

data class MatrixClientConfiguration(var name: String? = null, var storeTimelineEventContentUnencrypted: Boolean = true, var markOwnMessageAsRead: Boolean = false, var autoJoinUpgradedRooms: Boolean = true, var deleteRoomsOnLeave: Boolean = true, var deleteRooms: MatrixClientConfiguration.DeleteRooms = DeleteRooms.WhenNotJoined, var deleteSentOutboxMessageDelay: Duration = 10.seconds, var userPresenceActivityThreshold: Duration = 5.minutes, var cacheExpireDurations: MatrixClientConfiguration.CacheExpireDurations = CacheExpireDurations.default(1.minutes), var syncLoopTimeout: Duration = 30.seconds, var syncLoopDelays: MatrixClientConfiguration.SyncLoopDelays = SyncLoopDelays.default(), var syncErrorDelayConfig: RetryFlowDelayConfig = RetryFlowDelayConfig.sync, var lastRelevantEventFilter: (ClientEvent.RoomEvent<*>) -> Boolean = { it is RoomEvent.MessageEvent<*> }, var syncFilter: Filters = Filters(), var syncOnceFilter: Filters = Filters(presence = Filters.EventFilter(limit = 0)), var httpClientEngine: HttpClientEngine? = null, var httpClientConfig: HttpClientConfig<*>.() -> Unit? = null, var modules: List<Module>? = null, var modulesFactory: () -> List<Module>? = null, var modulesFactories: List<ModuleFactory> = createTrixnityDefaultModuleFactories(), var matrixClientServerApiClientFactory: MatrixClientServerApiClientFactory = object : MatrixClientServerApiClientFactory {}, val experimentalFeatures: MatrixClientConfiguration.ExperimentalFeatures = ExperimentalFeatures())

Constructors

Link copied to clipboard
constructor(name: String? = null, storeTimelineEventContentUnencrypted: Boolean = true, markOwnMessageAsRead: Boolean = false, autoJoinUpgradedRooms: Boolean = true, deleteRoomsOnLeave: Boolean = true, deleteRooms: MatrixClientConfiguration.DeleteRooms = DeleteRooms.WhenNotJoined, deleteSentOutboxMessageDelay: Duration = 10.seconds, userPresenceActivityThreshold: Duration = 5.minutes, cacheExpireDurations: MatrixClientConfiguration.CacheExpireDurations = CacheExpireDurations.default(1.minutes), syncLoopTimeout: Duration = 30.seconds, syncLoopDelays: MatrixClientConfiguration.SyncLoopDelays = SyncLoopDelays.default(), syncErrorDelayConfig: RetryFlowDelayConfig = RetryFlowDelayConfig.sync, lastRelevantEventFilter: (ClientEvent.RoomEvent<*>) -> Boolean = { it is RoomEvent.MessageEvent<*> }, syncFilter: Filters = Filters(), syncOnceFilter: Filters = Filters(presence = Filters.EventFilter(limit = 0)), httpClientEngine: HttpClientEngine? = null, httpClientConfig: HttpClientConfig<*>.() -> Unit? = null, modules: List<Module>? = null, modulesFactory: () -> List<Module>? = null, modulesFactories: List<ModuleFactory> = createTrixnityDefaultModuleFactories(), matrixClientServerApiClientFactory: MatrixClientServerApiClientFactory = object : MatrixClientServerApiClientFactory {}, experimentalFeatures: MatrixClientConfiguration.ExperimentalFeatures = ExperimentalFeatures())

Types

Link copied to clipboard
data class CacheExpireDurations(val globalAccountDate: Duration, val deviceKeys: Duration, val crossSigningKeys: Duration, val keyVerificationState: Duration, val mediaCacheMapping: Duration, val olmSession: Duration, val inboundMegolmSession: Duration, val inboundMegolmMessageIndex: Duration, val outboundMegolmSession: Duration, val roomAccountData: Duration, val roomState: Duration, val timelineEvent: Duration, val timelineEventRelation: Duration, val roomUser: Duration, val roomUserReceipts: Duration, val secretKeyRequest: Duration, val roomKeyRequest: Duration, val roomOutboxMessage: Duration, val room: Duration, val presence: Duration, val media: Duration)
Link copied to clipboard
sealed interface DeleteRooms

Trixnity will delete rooms based on different conditions:

Link copied to clipboard
data class ExperimentalFeatures(var enableMSC3814: Boolean = false)
Link copied to clipboard
data class SyncLoopDelays(val syncLoopDelay: Duration, val syncLoopErrorDelay: Duration)

Properties

Link copied to clipboard

Automatically join upgraded rooms.

Link copied to clipboard

Specifies how long values are kept in the cache when not used by anyone.

Link copied to clipboard
Link copied to clipboard

Delete a room, when it's membership is Membership.LEAVE.

Link copied to clipboard

Set the delay, after which a sent outbox message is deleted. The delay is checked each time a sync is received.

Link copied to clipboard
var httpClientConfig: HttpClientConfig<*>.() -> Unit?

Configure the underlying HttpClient.

Link copied to clipboard
var httpClientEngine: HttpClientEngine?

Specify a HttpClientEngine. This should be reused in an application.

Link copied to clipboard
var lastRelevantEventFilter: (ClientEvent.RoomEvent<*>) -> Boolean

Allows you to customize, which Room.lastRelevantEventId is set.

Link copied to clipboard

Sets the own read marker to the latest messages sent by this client.

Link copied to clipboard
var matrixClientServerApiClientFactory: MatrixClientServerApiClientFactory

If you need to override standard behavior of API clients, provide a MatrixClientServerApiClientFactory here, and override one or more API clients in net.folivo.trixnity.clientserverapi.client.MatrixClientServerApiClient.

Link copied to clipboard
var modules: List<Module>?

Inject and override modules into Trixnity. You should always apply createDefaultTrixnityModules first.

Link copied to clipboard

Inject and override modules into Trixnity. By default, this is createDefaultTrixnityModules.

Link copied to clipboard
var modulesFactory: () -> List<Module>?

Inject and override modules into Trixnity. You should always apply createDefaultTrixnityModules first.

Link copied to clipboard
var name: String?

Set a name for this instance. This is used to set a CoroutineName to the CoroutineContext.

Link copied to clipboard
Link copied to clipboard
var syncErrorDelayConfig: RetryFlowDelayConfig

Set custom delays for the sync loop.

Link copied to clipboard
var syncFilter: Filters

Set filter for the normal sync.

Link copied to clipboard

Set custom delays for the sync loop.

Link copied to clipboard

The timeout for the normal sync loop.

Link copied to clipboard
var syncOnceFilter: Filters

Set filter for the single sync (background sync).

Link copied to clipboard

Set the threshold after user presence is marked as unavailable.