Simplify code
This commit is contained in:
parent
d2b39e5cb8
commit
7c0acc8ccf
|
@ -83,13 +83,12 @@ class ViewEditHistoryViewModel @AssistedInject constructor(@Assisted
|
|||
|
||||
val events = data.map { event ->
|
||||
val timelineID = event.roomId + UUID.randomUUID().toString()
|
||||
event.also {
|
||||
// We need to check encryption
|
||||
if (it.isEncrypted() && it.mxDecryptionResult == null) {
|
||||
if (event.isEncrypted() && event.mxDecryptionResult == null) {
|
||||
// for now decrypt sync
|
||||
try {
|
||||
val result = session.cryptoService().decryptEvent(it, timelineID)
|
||||
it.mxDecryptionResult = OlmDecryptionResult(
|
||||
val result = session.cryptoService().decryptEvent(event, timelineID)
|
||||
event.mxDecryptionResult = OlmDecryptionResult(
|
||||
payload = result.clearEvent,
|
||||
senderKey = result.senderCurve25519Key,
|
||||
keysClaimed = result.claimedEd25519Key?.let { k -> mapOf("ed25519" to k) },
|
||||
|
@ -100,9 +99,8 @@ class ViewEditHistoryViewModel @AssistedInject constructor(@Assisted
|
|||
}
|
||||
}
|
||||
|
||||
if (event.eventId == it.eventId) {
|
||||
originalIsReply = it.isReply()
|
||||
}
|
||||
if (event.eventId == event.eventId) {
|
||||
originalIsReply = event.isReply()
|
||||
}
|
||||
}
|
||||
setState {
|
||||
|
|
Loading…
Reference in New Issue