Uses the remote attachment info when sending a message

Adding the local and remote attachments might lead to duplicated
attachments, potentially. At the time of sending, the local and
remote attachments should be the same.

MAILAND-3070
This commit is contained in:
Maciej Surmacz 2023-07-06 12:47:22 +02:00
parent a7ddf1f4ea
commit a08a524a7f
1 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,8 @@ class SendMessageWorker @AssistedInject constructor(
tryWithRetry {
messageDetailsRepository.getRemoteMessageDetails(messageId, userId)
}.map { remoteDraft ->
localDraft.attachments = localDraft.attachments.plus(remoteDraft.attachments)
localDraft.attachments = remoteDraft.attachments
localDraft.numAttachments = remoteDraft.numAttachments
}
return localDraft
}