Only mark exported attachment as wasDownloaded if plaintextHash present.

This commit is contained in:
Greyson Parrelli
2025-11-06 10:46:28 -05:00
committed by Michelle Tang
parent 4c00337b1a
commit 75346c3f6b

View File

@@ -1254,9 +1254,10 @@ private fun List<DatabaseAttachment>.toRemoteQuoteAttachments(): List<Quote.Quot
}
private fun DatabaseAttachment.toRemoteMessageAttachment(flagOverride: MessageAttachment.Flag? = null, contentTypeOverride: String? = null): MessageAttachment {
val pointer = this.toRemoteFilePointer(contentTypeOverride)
return MessageAttachment(
pointer = this.toRemoteFilePointer(contentTypeOverride),
wasDownloaded = this.transferState == AttachmentTable.TRANSFER_PROGRESS_DONE || this.transferState == AttachmentTable.TRANSFER_NEEDS_RESTORE,
pointer = pointer,
wasDownloaded = (this.transferState == AttachmentTable.TRANSFER_PROGRESS_DONE || this.transferState == AttachmentTable.TRANSFER_NEEDS_RESTORE) && pointer.locatorInfo?.plaintextHash != null,
flag = if (flagOverride != null) {
flagOverride
} else if (this.voiceNote) {