deps(rust sdk) : update to 25.03.20 and fix api change
This commit is contained in:
parent
93d27735e4
commit
29bc9ee68f
2 changed files with 11 additions and 11 deletions
|
|
@ -174,7 +174,7 @@ jsoup = "org.jsoup:jsoup:1.19.1"
|
||||||
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
|
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
|
||||||
molecule-runtime = "app.cash.molecule:molecule-runtime:2.0.0"
|
molecule-runtime = "app.cash.molecule:molecule-runtime:2.0.0"
|
||||||
timber = "com.jakewharton.timber:timber:5.0.1"
|
timber = "com.jakewharton.timber:timber:5.0.1"
|
||||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.3.13"
|
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.3.20"
|
||||||
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
|
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
|
||||||
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
|
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
|
||||||
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
|
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ import org.matrix.rustcomponents.sdk.QrCodeDecodeException
|
||||||
import org.matrix.rustcomponents.sdk.QrLoginProgress
|
import org.matrix.rustcomponents.sdk.QrLoginProgress
|
||||||
import org.matrix.rustcomponents.sdk.QrLoginProgressListener
|
import org.matrix.rustcomponents.sdk.QrLoginProgressListener
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import uniffi.matrix_sdk.OidcAuthorizationData
|
import uniffi.matrix_sdk.OAuthAuthorizationData
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
|
|
@ -183,18 +183,18 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var pendingOidcAuthorizationData: OidcAuthorizationData? = null
|
private var pendingOAuthAuthorizationData: OAuthAuthorizationData? = null
|
||||||
|
|
||||||
override suspend fun getOidcUrl(prompt: OidcPrompt): Result<OidcDetails> {
|
override suspend fun getOidcUrl(prompt: OidcPrompt): Result<OidcDetails> {
|
||||||
return withContext(coroutineDispatchers.io) {
|
return withContext(coroutineDispatchers.io) {
|
||||||
runCatching {
|
runCatching {
|
||||||
val client = currentClient ?: error("You need to call `setHomeserver()` first")
|
val client = currentClient ?: error("You need to call `setHomeserver()` first")
|
||||||
val oidcAuthenticationData = client.urlForOidc(
|
val oAuthAuthenticationData = client.urlForOidc(
|
||||||
oidcConfiguration = oidcConfigurationProvider.get(),
|
oidcConfiguration = oidcConfigurationProvider.get(),
|
||||||
prompt = prompt.toRustPrompt(),
|
prompt = prompt.toRustPrompt(),
|
||||||
)
|
)
|
||||||
val url = oidcAuthenticationData.loginUrl()
|
val url = oAuthAuthenticationData.loginUrl()
|
||||||
pendingOidcAuthorizationData = oidcAuthenticationData
|
pendingOAuthAuthorizationData = oAuthAuthenticationData
|
||||||
OidcDetails(url)
|
OidcDetails(url)
|
||||||
}.mapFailure { failure ->
|
}.mapFailure { failure ->
|
||||||
failure.mapAuthenticationException()
|
failure.mapAuthenticationException()
|
||||||
|
|
@ -205,8 +205,8 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||||
override suspend fun cancelOidcLogin(): Result<Unit> {
|
override suspend fun cancelOidcLogin(): Result<Unit> {
|
||||||
return withContext(coroutineDispatchers.io) {
|
return withContext(coroutineDispatchers.io) {
|
||||||
runCatching {
|
runCatching {
|
||||||
pendingOidcAuthorizationData?.close()
|
pendingOAuthAuthorizationData?.close()
|
||||||
pendingOidcAuthorizationData = null
|
pendingOAuthAuthorizationData = null
|
||||||
}.mapFailure { failure ->
|
}.mapFailure { failure ->
|
||||||
failure.mapAuthenticationException()
|
failure.mapAuthenticationException()
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +221,7 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||||
runCatching {
|
runCatching {
|
||||||
val client = currentClient ?: error("You need to call `setHomeserver()` first")
|
val client = currentClient ?: error("You need to call `setHomeserver()` first")
|
||||||
val currentSessionPaths = sessionPaths ?: error("You need to call `setHomeserver()` first")
|
val currentSessionPaths = sessionPaths ?: error("You need to call `setHomeserver()` first")
|
||||||
val urlForOidcLogin = pendingOidcAuthorizationData ?: error("You need to call `getOidcUrl()` first")
|
val urlForOidcLogin = pendingOAuthAuthorizationData ?: error("You need to call `getOidcUrl()` first")
|
||||||
client.loginWithOidcCallback(urlForOidcLogin, callbackUrl)
|
client.loginWithOidcCallback(urlForOidcLogin, callbackUrl)
|
||||||
val sessionData = client.session().toSessionData(
|
val sessionData = client.session().toSessionData(
|
||||||
isTokenValid = true,
|
isTokenValid = true,
|
||||||
|
|
@ -229,8 +229,8 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||||
passphrase = pendingPassphrase,
|
passphrase = pendingPassphrase,
|
||||||
sessionPaths = currentSessionPaths,
|
sessionPaths = currentSessionPaths,
|
||||||
)
|
)
|
||||||
pendingOidcAuthorizationData?.close()
|
pendingOAuthAuthorizationData?.close()
|
||||||
pendingOidcAuthorizationData = null
|
pendingOAuthAuthorizationData = null
|
||||||
newMatrixClientObserver?.invoke(rustMatrixClientFactory.create(client))
|
newMatrixClientObserver?.invoke(rustMatrixClientFactory.create(client))
|
||||||
sessionStore.storeData(sessionData)
|
sessionStore.storeData(sessionData)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue