diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt index e68cac31a3..c0407ca4e8 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt @@ -627,7 +627,7 @@ internal class RustCryptoService @Inject constructor( } private fun notifyRoomKeyReceived( - roomId: String, + roomId: String?, sessionId: String, ) { megolmSessionImportManager.dispatchNewSession(roomId, sessionId) @@ -665,8 +665,8 @@ internal class RustCryptoService @Inject constructor( EventType.ROOM_KEY -> { val content = event.getClearContent().toModel() ?: return@forEach - val roomId = content.sessionId ?: return@forEach - val sessionId = content.sessionId + val roomId = content.roomId + val sessionId = content.sessionId ?: return@forEach notifyRoomKeyReceived(roomId, sessionId) matrixConfiguration.cryptoAnalyticsPlugin?.onRoomKeyImported(sessionId, EventType.ROOM_KEY) @@ -674,8 +674,8 @@ internal class RustCryptoService @Inject constructor( EventType.FORWARDED_ROOM_KEY -> { val content = event.getClearContent().toModel() ?: return@forEach - val roomId = content.sessionId ?: return@forEach - val sessionId = content.sessionId + val roomId = content.roomId + val sessionId = content.sessionId ?: return@forEach notifyRoomKeyReceived(roomId, sessionId) matrixConfiguration.cryptoAnalyticsPlugin?.onRoomKeyImported(sessionId, EventType.FORWARDED_ROOM_KEY)