From 825760d17e4f0eb376ecc7f8bd6eaf083ce1838d Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 27 Aug 2019 17:01:52 +0200 Subject: [PATCH] Fix / regression on e2e reply and edit of reply --- CHANGES.md | 1 + .../session/room/relation/DefaultRelationService.kt | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a3b37761..d657337b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Bugfix: - Fix text diff linebreak display (#441) - Date change message repeats for each redaction until a normal message (#358) - Slide-in reply icon is distorted (#423) + - Regression / e2e replies not encrypted Translations: - diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt index addad44b..9640cd4e 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt @@ -136,7 +136,7 @@ internal class DefaultRelationService @AssistedInject constructor(@Assisted priv } if (cryptoService.isRoomEncrypted(roomId)) { val encryptWork = createEncryptEventWork(event, listOf("m.relates_to")) - val workRequest = createSendEventWork(event) + val workRequest = createSendEventWork(event, false) TimelineSendEventWorkCommon.postSequentialWorks(context, roomId, encryptWork, workRequest) return CancelableWork(context, encryptWork.id) @@ -162,7 +162,7 @@ internal class DefaultRelationService @AssistedInject constructor(@Assisted priv } if (cryptoService.isRoomEncrypted(roomId)) { val encryptWork = createEncryptEventWork(event, listOf("m.relates_to")) - val workRequest = createSendEventWork(event) + val workRequest = createSendEventWork(event, false) TimelineSendEventWorkCommon.postSequentialWorks(context, roomId, encryptWork, workRequest) return CancelableWork(context, encryptWork.id) @@ -189,7 +189,7 @@ internal class DefaultRelationService @AssistedInject constructor(@Assisted priv if (cryptoService.isRoomEncrypted(roomId)) { val encryptWork = createEncryptEventWork(event, listOf("m.relates_to")) - val workRequest = createSendEventWork(event) + val workRequest = createSendEventWork(event, false) TimelineSendEventWorkCommon.postSequentialWorks(context, roomId, encryptWork, workRequest) return CancelableWork(context, encryptWork.id) @@ -208,10 +208,10 @@ internal class DefaultRelationService @AssistedInject constructor(@Assisted priv return TimelineSendEventWorkCommon.createWork(sendWorkData, true) } - private fun createSendEventWork(event: Event): OneTimeWorkRequest { + private fun createSendEventWork(event: Event, startChain: Boolean = true): OneTimeWorkRequest { val sendContentWorkerParams = SendEventWorker.Params(credentials.userId, roomId, event) val sendWorkData = WorkerParamsFactory.toData(sendContentWorkerParams) - return TimelineSendEventWorkCommon.createWork(sendWorkData, true) + return TimelineSendEventWorkCommon.createWork(sendWorkData, startChain) } override fun getEventSummaryLive(eventId: String): LiveData {