Skip to content

Commit d215b5c

Browse files
authored
Merge pull request #4452 from element-hq/feature/fga/update_rust_sdk_25.03.20
deps(rust sdk) : update to 25.03.20 and fix api change
2 parents a066197 + 17d5d1e commit d215b5c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jsoup = "org.jsoup:jsoup:1.19.1"
174174
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
175175
molecule-runtime = "app.cash.molecule:molecule-runtime:2.0.0"
176176
timber = "com.jakewharton.timber:timber:5.0.1"
177-
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.3.13"
177+
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.3.20"
178178
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
179179
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
180180
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import org.matrix.rustcomponents.sdk.QrCodeDecodeException
4848
import org.matrix.rustcomponents.sdk.QrLoginProgress
4949
import org.matrix.rustcomponents.sdk.QrLoginProgressListener
5050
import timber.log.Timber
51-
import uniffi.matrix_sdk.OidcAuthorizationData
51+
import uniffi.matrix_sdk.OAuthAuthorizationData
5252
import javax.inject.Inject
5353

5454
@ContributesBinding(AppScope::class)
@@ -183,18 +183,18 @@ class RustMatrixAuthenticationService @Inject constructor(
183183
}
184184
}
185185

186-
private var pendingOidcAuthorizationData: OidcAuthorizationData? = null
186+
private var pendingOAuthAuthorizationData: OAuthAuthorizationData? = null
187187

188188
override suspend fun getOidcUrl(prompt: OidcPrompt): Result<OidcDetails> {
189189
return withContext(coroutineDispatchers.io) {
190190
runCatching {
191191
val client = currentClient ?: error("You need to call `setHomeserver()` first")
192-
val oidcAuthenticationData = client.urlForOidc(
192+
val oAuthAuthenticationData = client.urlForOidc(
193193
oidcConfiguration = oidcConfigurationProvider.get(),
194194
prompt = prompt.toRustPrompt(),
195195
)
196-
val url = oidcAuthenticationData.loginUrl()
197-
pendingOidcAuthorizationData = oidcAuthenticationData
196+
val url = oAuthAuthenticationData.loginUrl()
197+
pendingOAuthAuthorizationData = oAuthAuthenticationData
198198
OidcDetails(url)
199199
}.mapFailure { failure ->
200200
failure.mapAuthenticationException()
@@ -205,8 +205,8 @@ class RustMatrixAuthenticationService @Inject constructor(
205205
override suspend fun cancelOidcLogin(): Result<Unit> {
206206
return withContext(coroutineDispatchers.io) {
207207
runCatching {
208-
pendingOidcAuthorizationData?.close()
209-
pendingOidcAuthorizationData = null
208+
pendingOAuthAuthorizationData?.close()
209+
pendingOAuthAuthorizationData = null
210210
}.mapFailure { failure ->
211211
failure.mapAuthenticationException()
212212
}
@@ -221,16 +221,16 @@ class RustMatrixAuthenticationService @Inject constructor(
221221
runCatching {
222222
val client = currentClient ?: error("You need to call `setHomeserver()` first")
223223
val currentSessionPaths = sessionPaths ?: error("You need to call `setHomeserver()` first")
224-
val urlForOidcLogin = pendingOidcAuthorizationData ?: error("You need to call `getOidcUrl()` first")
224+
val urlForOidcLogin = pendingOAuthAuthorizationData ?: error("You need to call `getOidcUrl()` first")
225225
client.loginWithOidcCallback(urlForOidcLogin, callbackUrl)
226226
val sessionData = client.session().toSessionData(
227227
isTokenValid = true,
228228
loginType = LoginType.OIDC,
229229
passphrase = pendingPassphrase,
230230
sessionPaths = currentSessionPaths,
231231
)
232-
pendingOidcAuthorizationData?.close()
233-
pendingOidcAuthorizationData = null
232+
pendingOAuthAuthorizationData?.close()
233+
pendingOAuthAuthorizationData = null
234234
newMatrixClientObserver?.invoke(rustMatrixClientFactory.create(client))
235235
sessionStore.storeData(sessionData)
236236

0 commit comments

Comments
 (0)