@@ -323,7 +323,7 @@ class NewMessageViewModel @Inject constructor(
323
323
ApiRepository .attachmentsToForward(mailboxUuid, previousMessage).data?.attachments?.forEach { attachment ->
324
324
draft.attachments + = attachment.apply {
325
325
resource = previousMessage.attachments.find { it.name == name }?.resource
326
- setUploadStatus(AttachmentUploadStatus .FINISHED )
326
+ setUploadStatus(AttachmentUploadStatus .UPLOADED )
327
327
}
328
328
SentryDebug .addDraftBreadcrumbs(draft, step = " set previousMessage when reply/replyAll/Forward" )
329
329
}
@@ -507,11 +507,11 @@ class NewMessageViewModel @Inject constructor(
507
507
return ApiRepository .getDraft(draftResource!! ).data?.also { draft ->
508
508
509
509
/* *
510
- * If we are opening for the 1st time an existing Draft created somewhere else (ex: webmail),
511
- * we need to set all of its Attachments to `FINISHED` , so we don't try to upload them again.
510
+ * If we are opening for the 1st time an existing Draft created somewhere else (ex: webmail), we need to
511
+ * set all of its Attachments to [AttachmentUploadStatus.UPLOADED] , so we don't try to upload them again.
512
512
*/
513
513
draft.attachments.forEach {
514
- it.setUploadStatus(AttachmentUploadStatus .FINISHED , draft, " fetchDraft at NewMessage opening" )
514
+ it.setUploadStatus(AttachmentUploadStatus .UPLOADED , draft, " fetchDraft at NewMessage opening" )
515
515
}
516
516
517
517
/* *
@@ -989,7 +989,7 @@ class NewMessageViewModel @Inject constructor(
989
989
* Then it means the Attachments list hasn't been edited by the user, so we have nothing to do here.
990
990
*/
991
991
val isForwardingUneditedAttachmentsList = draftMode == DraftMode .FORWARD &&
992
- uiAttachments.all { it.attachmentUploadStatus == AttachmentUploadStatus .FINISHED } &&
992
+ uiAttachments.all { it.attachmentUploadStatus == AttachmentUploadStatus .UPLOADED } &&
993
993
uiAttachments.count() == attachments.count()
994
994
if (isForwardingUneditedAttachmentsList) return
995
995
@@ -1002,7 +1002,7 @@ class NewMessageViewModel @Inject constructor(
1002
1002
* be some data for Attachments in Realm (for example, the `uuid`). If we don't take back the Realm version of the
1003
1003
* Attachment, this data will be lost forever and we won't be able to save/send the Draft.
1004
1004
*/
1005
- return @map if (localAttachment != null && localAttachment.attachmentUploadStatus != AttachmentUploadStatus .AWAITING ) {
1005
+ return @map if (localAttachment != null && localAttachment.attachmentUploadStatus == AttachmentUploadStatus .UPLOADED ) {
1006
1006
localAttachment.copyFromRealm()
1007
1007
} else {
1008
1008
uiAttachment
0 commit comments