Skip to content

Commit ef11a3b

Browse files
Update dependency org.matrix.rustcomponents:sdk-android to v25.7.15 (#5011)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <[email protected]>
1 parent e8154ec commit ef11a3b

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jsoup = "org.jsoup:jsoup:1.21.1"
176176
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
177177
molecule-runtime = "app.cash.molecule:molecule-runtime:2.1.0"
178178
timber = "com.jakewharton.timber:timber:5.0.1"
179-
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.7.10"
179+
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.7.15"
180180
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
181181
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
182182
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: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import kotlinx.coroutines.withContext
4343
import org.matrix.rustcomponents.sdk.Client
4444
import org.matrix.rustcomponents.sdk.ClientBuilder
4545
import org.matrix.rustcomponents.sdk.HumanQrLoginException
46-
import org.matrix.rustcomponents.sdk.OidcConfiguration
4746
import org.matrix.rustcomponents.sdk.QrCodeData
4847
import org.matrix.rustcomponents.sdk.QrCodeDecodeException
4948
import org.matrix.rustcomponents.sdk.QrLoginProgress
@@ -199,6 +198,8 @@ class RustMatrixAuthenticationService @Inject constructor(
199198
oidcConfiguration = oidcConfigurationProvider.get(),
200199
prompt = prompt.toRustPrompt(),
201200
loginHint = loginHint,
201+
// If we want to restore a previous session for which we have encryption keys, we can pass the deviceId here. At the moment, we don't
202+
deviceId = null,
202203
)
203204
val url = oAuthAuthorizationData.loginUrl()
204205
pendingOAuthAuthorizationData = oAuthAuthorizationData
@@ -274,9 +275,13 @@ class RustMatrixAuthenticationService @Inject constructor(
274275
sessionPaths = emptySessionPaths,
275276
passphrase = pendingPassphrase,
276277
qrCodeData = sdkQrCodeLoginData,
278+
)
279+
client.loginWithQrCode(
280+
qrCodeData = qrCodeData.rustQrCodeData,
277281
oidcConfiguration = oidcConfiguration,
278282
progressListener = progressListener,
279283
)
284+
280285
val sessionData = client.session()
281286
.toSessionData(
282287
isTokenValid = true,
@@ -324,8 +329,6 @@ class RustMatrixAuthenticationService @Inject constructor(
324329
sessionPaths: SessionPaths,
325330
passphrase: String?,
326331
qrCodeData: QrCodeData,
327-
oidcConfiguration: OidcConfiguration,
328-
progressListener: QrLoginProgressListener,
329332
): Client {
330333
Timber.d("Creating client for QR Code login with simplified sliding sync")
331334
return rustMatrixClientFactory
@@ -335,7 +338,8 @@ class RustMatrixAuthenticationService @Inject constructor(
335338
slidingSyncType = ClientBuilderSlidingSync.Discovered,
336339
)
337340
.sessionPassphrase(passphrase)
338-
.buildWithQrCode(qrCodeData, oidcConfiguration, progressListener)
341+
.serverNameOrHomeserverUrl(qrCodeData.serverName()!!)
342+
.build()
339343
}
340344

341345
private fun clear() {

libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiClientBuilder.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import org.matrix.rustcomponents.sdk.Client
1111
import org.matrix.rustcomponents.sdk.ClientBuilder
1212
import org.matrix.rustcomponents.sdk.ClientSessionDelegate
1313
import org.matrix.rustcomponents.sdk.NoPointer
14-
import org.matrix.rustcomponents.sdk.OidcConfiguration
15-
import org.matrix.rustcomponents.sdk.QrCodeData
16-
import org.matrix.rustcomponents.sdk.QrLoginProgressListener
1714
import org.matrix.rustcomponents.sdk.RequestConfig
1815
import org.matrix.rustcomponents.sdk.SlidingSyncVersionBuilder
1916
import uniffi.matrix_sdk.BackupDownloadStrategy
@@ -43,10 +40,6 @@ class FakeFfiClientBuilder : ClientBuilder(NoPointer) {
4340
override fun username(username: String) = this
4441
override fun enableShareHistoryOnInvite(enableShareHistoryOnInvite: Boolean): ClientBuilder = this
4542

46-
override suspend fun buildWithQrCode(qrCodeData: QrCodeData, oidcConfiguration: OidcConfiguration, progressListener: QrLoginProgressListener): Client {
47-
return FakeFfiClient()
48-
}
49-
5043
override suspend fun build(): Client {
5144
return FakeFfiClient(withUtdHook = {})
5245
}

0 commit comments

Comments
 (0)