diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt index bad8b3766d..196b419598 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt @@ -219,10 +219,16 @@ data class Event( } /** - * @return the event content + * @return the event content. + * If the content is encrypted, it will return the decrypted content, or null if the content is not + * decrypted. */ fun getClearContent(): Content? { - return getDecryptedContent() ?: content + return if (isEncrypted()) { + getDecryptedContent() + } else { + content + } } /**