Don't back up oversized text attachments
This commit is contained in:
parent
365067ef41
commit
58d367afe5
@ -50,6 +50,10 @@ extension Attachment {
|
||||
mediaTierInfo.isUploaded(currentUploadEra: currentUploadEra)
|
||||
else {
|
||||
// Don't offload until we've backed up to media tier.
|
||||
// Note that attachments that are ineligible for media tier upload
|
||||
// (some DMs, view-once, oversized text) won't be uploaded and therefore
|
||||
// won't pass this check. We don't need to also check for "eligibility"
|
||||
// here and can just rely on upload mechanisms to have checked that.
|
||||
return false
|
||||
}
|
||||
if
|
||||
|
||||
@ -179,6 +179,10 @@ public class BackupAttachmentUploadSchedulerImpl: BackupAttachmentUploadSchedule
|
||||
return
|
||||
}
|
||||
|
||||
// We only include the provided owner because this is an incremental check;
|
||||
// if some other owner made the attachment eligible for upload, it'd already
|
||||
// be enqueued. We only care if this particular owner makes it newly eligible
|
||||
// (or it was eligible both before and now, but the enqueuing it idempotent).
|
||||
guard let uploadOwnerType = self.asEligibleUploadOwnerType(owner, tx: tx) else {
|
||||
return
|
||||
}
|
||||
@ -232,6 +236,20 @@ public class BackupAttachmentUploadSchedulerImpl: BackupAttachmentUploadSchedule
|
||||
) -> QueuedBackupAttachmentUpload.OwnerType? {
|
||||
switch owner {
|
||||
case .message(let messageSource):
|
||||
switch messageSource.rawMessageOwnerType {
|
||||
case .oversizeText:
|
||||
// We inline oversize text in the backup, and don't back
|
||||
// up the corresponding attachment.
|
||||
return nil
|
||||
case
|
||||
.bodyAttachment,
|
||||
.contactAvatar,
|
||||
.linkPreview,
|
||||
.quotedReplyAttachment,
|
||||
.sticker:
|
||||
break
|
||||
}
|
||||
|
||||
guard
|
||||
let message = interactionStore.fetchInteraction(
|
||||
rowId: messageSource.messageRowId,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user