From c0bac697339558cbef1a3161a41fd21fdbf5ae03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 16 Jun 2021 13:21:37 +0200 Subject: [PATCH] crypto-service: Use constants when we check the event type --- .../android/sdk/internal/crypto/DefaultCryptoService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt index aa307d7c8e..cf31327e18 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt @@ -663,14 +663,14 @@ internal class DefaultCryptoService @Inject constructor( // Notify the our listeners about room keys so decryption is retried. if (toDeviceEvents.events != null) { toDeviceEvents.events.forEach { event -> - if (event.type == "m.room_key") { + if (event.type == EventType.ROOM_KEY) { val content = event.getClearContent().toModel() ?: return@forEach val roomId = content.sessionId ?: return@forEach val sessionId = content.sessionId notifyRoomKeyReceival(roomId, sessionId) - } else if (event.type == "m.forwarded_room_key") { + } else if (event.type == EventType.FORWARDED_ROOM_KEY) { val content = event.getClearContent().toModel() ?: return@forEach val roomId = content.sessionId ?: return@forEach