From 36ed8802bbd79dcbe95f0a911fa1be29cbf0667b Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 2 Mar 2023 16:17:58 +1100 Subject: [PATCH] don't include the attachment when quoted if the attachment is not downloaded --- SessionMessagingKit/Database/Models/Attachment.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SessionMessagingKit/Database/Models/Attachment.swift b/SessionMessagingKit/Database/Models/Attachment.swift index fc004c92e..c91686a17 100644 --- a/SessionMessagingKit/Database/Models/Attachment.swift +++ b/SessionMessagingKit/Database/Models/Attachment.swift @@ -885,13 +885,16 @@ extension Attachment { guard self.isValid, - self.isVisualMedia, let thumbnailPath: String = Attachment.originalFilePath( id: cloneId, mimeType: OWSMimeTypeImageJpeg, sourceFilename: thumbnailName ) else { + return nil + } + + guard self.isVisualMedia else { // Non-media files cannot have thumbnails but may be sent as quotes, in these cases we want // to create an attachment in an 'uploaded' state with a hard-coded file id so the messageSend // job doesn't try to upload the attachment (we include the original `serverId` as it's