forked from GitHub-Mirror/riotX-android
cleaning
This commit is contained in:
parent
7d41352918
commit
51fdccb393
@ -118,7 +118,8 @@ internal class DefaultEventRelationsAggregationTask @Inject constructor(
|
|||||||
forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain
|
forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain
|
||||||
)
|
)
|
||||||
} catch (e: MXCryptoError) {
|
} catch (e: MXCryptoError) {
|
||||||
|
Timber.w("Failed to decrypt e2e replace")
|
||||||
|
//TODO -> we should keep track of this and retry, or aggregation will be broken
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.getClearContent().toModel<MessageContent>()?.let {
|
event.getClearContent().toModel<MessageContent>()?.let {
|
||||||
|
@ -28,6 +28,7 @@ import im.vector.matrix.android.api.session.room.model.message.isReply
|
|||||||
import im.vector.matrix.android.internal.crypto.algorithms.olm.OlmDecryptionResult
|
import im.vector.matrix.android.internal.crypto.algorithms.olm.OlmDecryptionResult
|
||||||
import im.vector.riotx.core.platform.VectorViewModel
|
import im.vector.riotx.core.platform.VectorViewModel
|
||||||
import im.vector.riotx.features.home.room.detail.timeline.helper.TimelineDateFormatter
|
import im.vector.riotx.features.home.room.detail.timeline.helper.TimelineDateFormatter
|
||||||
|
import timber.log.Timber
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
@ -84,27 +85,27 @@ class ViewEditHistoryViewModel @AssistedInject constructor(@Assisted
|
|||||||
override fun onSuccess(data: List<Event>) {
|
override fun onSuccess(data: List<Event>) {
|
||||||
var originalIsReply = false
|
var originalIsReply = false
|
||||||
|
|
||||||
val events = data.map {
|
val events = data.map { event ->
|
||||||
val timelineID = it.roomId + UUID.randomUUID().toString()
|
val timelineID = event.roomId + UUID.randomUUID().toString()
|
||||||
it.apply {
|
event.also {
|
||||||
//We need to check encryption
|
//We need to check encryption
|
||||||
if (isEncrypted() && mxDecryptionResult == null) {
|
if (it.isEncrypted() && it.mxDecryptionResult == null) {
|
||||||
//for now decrypt sync
|
//for now decrypt sync
|
||||||
try {
|
try {
|
||||||
val result = session.decryptEvent(this, timelineID)
|
val result = session.decryptEvent(it, timelineID)
|
||||||
mxDecryptionResult = OlmDecryptionResult(
|
it.mxDecryptionResult = OlmDecryptionResult(
|
||||||
payload = result.clearEvent,
|
payload = result.clearEvent,
|
||||||
senderKey = result.senderCurve25519Key,
|
senderKey = result.senderCurve25519Key,
|
||||||
keysClaimed = result.claimedEd25519Key?.let { k -> mapOf("ed25519" to k) },
|
keysClaimed = result.claimedEd25519Key?.let { k -> mapOf("ed25519" to k) },
|
||||||
forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain
|
forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain
|
||||||
)
|
)
|
||||||
} catch (e: MXCryptoError) {
|
} catch (e: MXCryptoError) {
|
||||||
|
Timber.w("Failed to decrypt event in history")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it.eventId == eventId) {
|
if (event.eventId == it.eventId) {
|
||||||
originalIsReply = getClearContent().toModel<MessageContent>().isReply()
|
originalIsReply = it.getClearContent().toModel<MessageContent>().isReply()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user