UserSessionScope

class UserSessionScope(userAgent: String, val userId: UserId, globalScope: GlobalKaliumScope, val globalCallManager: GlobalCallManager, globalDatabaseBuilder: GlobalDatabaseBuilder, globalPreferences: GlobalPrefProvider, authenticationScopeProvider: AuthenticationScopeProvider, val rootPathsProvider: RootPathsProvider, dataStoragePaths: DataStoragePaths, val kaliumConfigs: KaliumConfigs, userSessionScopeProvider: UserSessionScopeProvider, userStorageProvider: UserStorageProvider, userAuthenticatedNetworkProvider: UserAuthenticatedNetworkProvider, clientConfig: ClientConfig, platformUserStorageProperties: PlatformUserStorageProperties, networkStateObserver: NetworkStateObserver, logoutCallback: LogoutCallback, syncShutdownCoordinator: SyncShutdownCoordinator, enableDurableMLSReceiveRecovery: Boolean = false, resourceAccess: AccountResourceAccess? = null, coreCryptoCentralFactory: suspend (String, ByteArray) -> CoreCryptoCentral = { root, key -> com.wire.kalium.cryptography.coreCryptoCentral(root, key) }) : CoroutineScope

Constructors

Link copied to clipboard
internal constructor(userAgent: String, userId: UserId, globalScope: GlobalKaliumScope, globalCallManager: GlobalCallManager, globalDatabaseBuilder: GlobalDatabaseBuilder, globalPreferences: GlobalPrefProvider, authenticationScopeProvider: AuthenticationScopeProvider, rootPathsProvider: RootPathsProvider, dataStoragePaths: DataStoragePaths, kaliumConfigs: KaliumConfigs, userSessionScopeProvider: UserSessionScopeProvider, userStorageProvider: UserStorageProvider, userAuthenticatedNetworkProvider: UserAuthenticatedNetworkProvider, clientConfig: ClientConfig, platformUserStorageProperties: PlatformUserStorageProperties, networkStateObserver: NetworkStateObserver, logoutCallback: LogoutCallback, syncShutdownCoordinator: SyncShutdownCoordinator, enableDurableMLSReceiveRecovery: Boolean = false, resourceAccess: AccountResourceAccess? = null, coreCryptoCentralFactory: suspend (String, ByteArray) -> CoreCryptoCentral = { root, key -> com.wire.kalium.cryptography.coreCryptoCentral(root, key) })

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal val callMapper: CallMapper
Link copied to clipboard
Link copied to clipboard
val cells: CellsScope
Link copied to clipboard
internal val cellsClient: HttpClient
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val isCellsInitialized: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val longWork: LongWorkScope
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val notificationAlerts: UnnotifiedMessageAlerts

Apple alert claims using this session's existing account owner; the host must retain the session.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Read-only progress of the current slow-sync attempt.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal val userId: UserId
Link copied to clipboard
Link copied to clipboard
internal val userStorage: UserStorage

Functions

Link copied to clipboard

Attach one plain native view as the local camera preview. The caller owns its lifetime. Do not pass AVSVideoPreview, which attaches itself when added to a window.

Attach one plain native view as the local camera preview. The caller owns its lifetime. Do not pass AVSVideoPreview, which attaches itself when added to a window.

Link copied to clipboard
expect suspend fun UserSessionScope.attachRemoteVideoView(participantId: QualifiedID, clientId: String, view: PlatformView): RemoteVideoViewAttachment

Attach an iOS AVSVideoView to one remote client's stream. The caller owns the view lifetime. Different native views remain attached independently, including views of the same stream. Reattaching the same native view and stream returns its existing lease, even through another PlatformView wrapper. Rebinding that view to another stream detaches its previous attachment and invalidates the old lease. If that detach fails, the previous attachment remains owned and the new stream is not attached. If the new attach fails after detach succeeds, that view remains detached. Other views are unaffected. Operations run on the main dispatcher. The caller must detach each returned lease when its view disappears.

actual suspend fun UserSessionScope.attachRemoteVideoView(participantId: QualifiedID, clientId: String, view: PlatformView): RemoteVideoViewAttachment

Attach an iOS AVSVideoView to one remote client's stream. The caller owns the view lifetime. Different native views remain attached independently, including views of the same stream. Reattaching the same native view and stream returns its existing lease, even through another PlatformView wrapper. Rebinding that view to another stream detaches its previous attachment and invalidates the old lease. If that detach fails, the previous attachment remains owned and the new stream is not attached. If the new attach fails after detach succeeds, that view remains detached. Other views are unaffected. Operations run on the main dispatcher. The caller must detach each returned lease when its view disappears.

Link copied to clipboard
internal fun buildAudioNormalizedLoudnessWorker(conversationId: ConversationId, messageId: String): AudioNormalizedLoudnessWorker
Link copied to clipboard
suspend fun callPresentations(): List<CallPresentationRecord>
Link copied to clipboard
internal suspend fun closeAccountResources()
Link copied to clipboard
internal fun createIncrementalSyncWorker(eventGatherer: EventGatherer = this.eventGatherer): IncrementalSyncWorker
Link copied to clipboard
internal suspend fun <T> failNetworkRequests(block: suspend () -> T): T

Fail this account's HTTP requests, in flight and new, as having no network until block returns.

Link copied to clipboard
fun observeCallPresentations(): Flow<List<CallPresentationRecord>>
Link copied to clipboard
suspend fun observeIfE2EIRequiredDuringLogin(): Flow<Boolean?>
Link copied to clipboard
fun observeNotificationRemovalCandidates(messageIds: List<String>): Flow<List<NotificationMessageKey>>

Uses the existing account database owner, also observing sync performed by the app.

Link copied to clipboard

Register the identities of delivered Apple alerts before observing their canonical state.

Link copied to clipboard
suspend fun resumeIncomingCallSignals(callId: String)

Prioritize the exact delivered Apple call, preserving all signaling in its conversation.

Link copied to clipboard

Resume NSE-committed signaling using this session's existing full calling engine.

Link copied to clipboard
internal fun resumeSync()

Resume after ownership returns.

Link copied to clipboard
suspend fun UserSessionScope.serveShareExtension(doorbell: Flow<Unit>, refused: suspend (ConversationId, conversationName: String?, reason: String) -> Unit)

Answers the share extension while the app owns this account, live or not (ADR 13). It lists the account's conversations when the extension asks, and stores handed-off shares as the composer would: now, and whenever doorbell rings. Runs until cancelled, which must happen before the app releases the account. Servers of one account take turns. A share it refuses after the extension stopped waiting goes to refused, for the app to tell the user.

Link copied to clipboard
internal suspend fun stopAccountWork()

The host must first cancel/join public account operations and account/global observers.

Link copied to clipboard
internal suspend fun suspendSync(): SyncSuspension

Stop sync and close its WebSocket client before another process may receive this account's events. Legacy push skips clients the backend serves over an open WebSocket, and consumable notifications need a single consumer. The native socket and the backend see the close asynchronously. Sync stays stopped, even for new requests, until resumeSync or until the returned suspension is cancelled. Failure leaves sync running.