mirror of
https://github.com/element-hq/element-android
synced 2024-11-26 19:35:42 +03:00
Improve getClearContent() method: it should not fallback to the encrypted content when the content is not decrypted.
This commit is contained in:
parent
cc355a8e14
commit
a1140fd8fa
1 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue