Merge pull request #803 from RyanRory/fix-retry-sending-attachments
Fix retry sending attachments that are not downloaded
This commit is contained in:
commit
01e6a1c705
|
@ -1611,7 +1611,19 @@ extension ConversationVC:
|
|||
quotedAttachment.downloadUrl == Attachment.nonMediaQuoteFileId,
|
||||
let quotedInteraction = try? quote.originalInteraction.fetchOne(db)
|
||||
{
|
||||
let attachment = try? quotedInteraction.attachments.fetchAll(db).first
|
||||
let attachment: Attachment? = {
|
||||
if let attachment = try? quotedInteraction.attachments.fetchOne(db) {
|
||||
return attachment
|
||||
}
|
||||
if
|
||||
let linkPreview = try? quotedInteraction.linkPreview.fetchOne(db),
|
||||
let linkPreviewAttachment = try? linkPreview.attachment.fetchOne(db)
|
||||
{
|
||||
return linkPreviewAttachment
|
||||
}
|
||||
|
||||
return nil
|
||||
}()
|
||||
try quote.with(
|
||||
attachmentId: attachment?.cloneAsQuoteThumbnail()?.inserted(db).id
|
||||
).update(db)
|
||||
|
|
|
@ -883,9 +883,10 @@ extension Attachment {
|
|||
let cloneId: String = UUID().uuidString
|
||||
let thumbnailName: String = "quoted-thumbnail-\(sourceFilename ?? "null")"
|
||||
|
||||
guard self.isVisualMedia else { return nil }
|
||||
|
||||
guard
|
||||
self.isValid,
|
||||
self.isVisualMedia,
|
||||
let thumbnailPath: String = Attachment.originalFilePath(
|
||||
id: cloneId,
|
||||
mimeType: OWSMimeTypeImageJpeg,
|
||||
|
|
Loading…
Reference in New Issue