From f82bd64c102f935b1952880384a982e1bf19148e Mon Sep 17 00:00:00 2001 From: Clark Date: Tue, 23 Apr 2024 10:28:07 -0400 Subject: [PATCH] Copy inbound attachments to archive service. --- .../thoughtcrime/securesms/jobs/AttachmentDownloadJob.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.kt index 090564ffb4..a95ed497fe 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.kt @@ -175,6 +175,13 @@ class AttachmentDownloadJob private constructor( Cdn.S3 -> retrieveAttachmentForReleaseChannel(messageId, attachmentId, attachment) else -> retrieveAttachment(messageId, attachmentId, attachment) } + + if ((attachment.cdn == Cdn.CDN_2 || attachment.cdn == Cdn.CDN_3) && + attachment.archiveMediaId == null && + SignalStore.backup().canReadWriteToArchiveCdn + ) { + ApplicationDependencies.getJobManager().add(ArchiveAttachmentJob(attachmentId)) + } } override fun onFailure() {