Merge pull request #5796 from element-hq/renovate/org.matrix.rustcomponents-sdk-android-25.x
fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.11.24
This commit is contained in:
@@ -179,7 +179,7 @@ class RoomMemberListPresenter(
|
||||
return if (room.info().isEncrypted != true) {
|
||||
RoomMemberWithIdentityState(this, null)
|
||||
} else {
|
||||
val identityState = identityStates[userId] ?: encryptionService.getUserIdentity(userId).getOrNull()
|
||||
val identityState = identityStates[userId] ?: encryptionService.getUserIdentity(userId, fallbackToServer = false).getOrNull()
|
||||
RoomMemberWithIdentityState(this, identityState)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,14 +386,12 @@ class UserProfilePresenterTest {
|
||||
}
|
||||
|
||||
private fun createFakeMatrixClient(
|
||||
isUserVerified: Boolean = true,
|
||||
userIdentityState: IdentityState? = null,
|
||||
ignoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) },
|
||||
unIgnoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) },
|
||||
ignoredUsersFlow: StateFlow<ImmutableList<UserId>> = MutableStateFlow(persistentListOf())
|
||||
) = FakeMatrixClient(
|
||||
encryptionService = FakeEncryptionService(
|
||||
isUserVerifiedResult = { Result.success(isUserVerified) },
|
||||
getUserIdentityResult = { Result.success(userIdentityState) }
|
||||
),
|
||||
ignoreUserResult = ignoreUserResult,
|
||||
|
||||
@@ -178,7 +178,7 @@ test_detekt_test = { module = "io.gitlab.arturbosch.detekt:detekt-test", version
|
||||
# https://github.com/matrix-org/matrix-rust-components-kotlin/commits/main/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt
|
||||
# All new features should not be implemented in the pull request that upgrades the version, developers should
|
||||
# only fix API breaks and may add some TODOs.
|
||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.11.19"
|
||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.11.24"
|
||||
|
||||
# Others
|
||||
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
|
||||
|
||||
@@ -64,8 +64,6 @@ interface EncryptionService {
|
||||
*/
|
||||
suspend fun startIdentityReset(): Result<IdentityResetHandle?>
|
||||
|
||||
suspend fun isUserVerified(userId: UserId): Result<Boolean>
|
||||
|
||||
/**
|
||||
* Remember this identity, ensuring it does not result in a pin violation.
|
||||
*/
|
||||
@@ -82,8 +80,10 @@ interface EncryptionService {
|
||||
|
||||
/**
|
||||
* Get the identity state of a user, if known.
|
||||
* @param userId the user id to get the identity for.
|
||||
* @param fallbackToServer whether to fallback to fetching the identity from the server if not known locally. Defaults to true.
|
||||
*/
|
||||
suspend fun getUserIdentity(userId: UserId): Result<IdentityState?>
|
||||
suspend fun getUserIdentity(userId: UserId, fallbackToServer: Boolean = true): Result<IdentityState?>
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -240,10 +240,6 @@ class RustEncryptionService(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun isUserVerified(userId: UserId): Result<Boolean> = runCatchingExceptions {
|
||||
getUserIdentityInternal(userId).isVerified()
|
||||
}
|
||||
|
||||
override suspend fun pinUserIdentity(userId: UserId): Result<Unit> = runCatchingExceptions {
|
||||
getUserIdentityInternal(userId).pin()
|
||||
}
|
||||
@@ -252,8 +248,8 @@ class RustEncryptionService(
|
||||
getUserIdentityInternal(userId).withdrawVerification()
|
||||
}
|
||||
|
||||
override suspend fun getUserIdentity(userId: UserId): Result<IdentityState?> = runCatchingExceptions {
|
||||
val identity = getUserIdentityInternal(userId)
|
||||
override suspend fun getUserIdentity(userId: UserId, fallbackToServer: Boolean): Result<IdentityState?> = runCatchingExceptions {
|
||||
val identity = getUserIdentityInternal(userId, fallbackToServer)
|
||||
val isVerified = identity.isVerified()
|
||||
when {
|
||||
identity.hasVerificationViolation() -> IdentityState.VerificationViolation
|
||||
@@ -263,10 +259,10 @@ class RustEncryptionService(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getUserIdentityInternal(userId: UserId): UserIdentity {
|
||||
private suspend fun getUserIdentityInternal(userId: UserId, fallbackToServer: Boolean = true): UserIdentity {
|
||||
return service.userIdentity(
|
||||
userId = userId.value,
|
||||
// requestFromHomeserverIfNeeded = true,
|
||||
fallbackToServer = fallbackToServer,
|
||||
) ?: error("User identity not found")
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import kotlinx.coroutines.flow.flowOf
|
||||
class FakeEncryptionService(
|
||||
var startIdentityResetLambda: () -> Result<IdentityResetHandle?> = { lambdaError() },
|
||||
private val pinUserIdentityResult: (UserId) -> Result<Unit> = { lambdaError() },
|
||||
private val isUserVerifiedResult: (UserId) -> Result<Boolean> = { lambdaError() },
|
||||
private val withdrawVerificationResult: (UserId) -> Result<Unit> = { lambdaError() },
|
||||
private val getUserIdentityResult: (UserId) -> Result<IdentityState?> = { lambdaError() },
|
||||
private val enableRecoveryLambda: (Boolean) -> Result<Unit> = { lambdaError() },
|
||||
@@ -139,11 +138,7 @@ class FakeEncryptionService(
|
||||
return withdrawVerificationResult(userId)
|
||||
}
|
||||
|
||||
override suspend fun isUserVerified(userId: UserId): Result<Boolean> = simulateLongTask {
|
||||
isUserVerifiedResult(userId)
|
||||
}
|
||||
|
||||
override suspend fun getUserIdentity(userId: UserId): Result<IdentityState?> = simulateLongTask {
|
||||
override suspend fun getUserIdentity(userId: UserId, fallbackToServer: Boolean): Result<IdentityState?> = simulateLongTask {
|
||||
return getUserIdentityResult(userId)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user