Allow NEEDS_RESTORE attachments to be considered as 'couldBeOnArchiveCdn'.

This commit is contained in:
Greyson Parrelli
2025-08-26 12:10:54 -04:00
committed by Michelle Tang
parent 1a1ddbfa39
commit 9903a664d4

View File

@@ -227,7 +227,7 @@ private fun DatabaseAttachment.toRemoteAttachmentType(): AttachmentType {
}
val activelyOnArchiveCdn = this.archiveTransferState == AttachmentTable.ArchiveTransferState.FINISHED
val couldBeOnArchiveCdn = this.transferState == AttachmentTable.TRANSFER_PROGRESS_DONE && this.archiveTransferState != AttachmentTable.ArchiveTransferState.PERMANENT_FAILURE
val couldBeOnArchiveCdn = (this.transferState == AttachmentTable.TRANSFER_PROGRESS_DONE || this.transferState == AttachmentTable.TRANSFER_NEEDS_RESTORE) && this.archiveTransferState != AttachmentTable.ArchiveTransferState.PERMANENT_FAILURE
if (this.dataHash != null && (activelyOnArchiveCdn || couldBeOnArchiveCdn)) {
return AttachmentType.ARCHIVE