Merge pull request #1520 from vector-im/feature/bma/sessionDb
Improve session db and improve deleted session behavior
This commit is contained in:
commit
88ca37984f
43 changed files with 968 additions and 49 deletions
|
|
@ -18,12 +18,18 @@ package io.element.android.libraries.matrix.api.auth
|
|||
|
||||
import io.element.android.libraries.matrix.api.MatrixClient
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
import io.element.android.libraries.sessionstorage.api.LoggedInState
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
interface MatrixAuthenticationService {
|
||||
fun isLoggedIn(): Flow<Boolean>
|
||||
fun loggedInStateFlow(): Flow<LoggedInState>
|
||||
suspend fun getLatestSessionId(): SessionId?
|
||||
|
||||
/**
|
||||
* Restore a session from a [sessionId].
|
||||
* Do not restore anything it the access token is not valid anymore.
|
||||
*/
|
||||
suspend fun restoreSession(sessionId: SessionId): Result<MatrixClient>
|
||||
fun getHomeserverDetails(): StateFlow<MatrixHomeServerDetails?>
|
||||
suspend fun setHomeserver(homeserver: String): Result<Unit>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue