From ebed3195bfd53c8c3d4088570ec2bcbd1507aef9 Mon Sep 17 00:00:00 2001 From: valere Date: Thu, 2 Feb 2023 16:15:53 +0100 Subject: [PATCH] fix new error reported from rust side --- .../org/matrix/android/sdk/internal/crypto/OlmMachine.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt index 838dbf30f7..f5b9ec17a1 100644 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt @@ -468,10 +468,13 @@ internal class OlmMachine @Inject constructor( ) } catch (throwable: Throwable) { val reThrow = when (throwable) { - is DecryptionException.Megolm -> { - // TODO more bindings for missing room key + is DecryptionException.MissingRoomKey -> { MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID, throwable.message.orEmpty()) } + is DecryptionException.Megolm -> { + // TODO check if it's the correct binding? + MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX, throwable.message.orEmpty()) + } is DecryptionException.Identifier -> { MXCryptoError.Base(MXCryptoError.ErrorType.BAD_EVENT_FORMAT, MXCryptoError.BAD_EVENT_FORMAT_TEXT_REASON) }