fix an issue when quoting messages with multiple attachments, the quoted attachment doesn't stay the same.

pull/782/head
ryanzhao 2 years ago
parent cac8d22e0b
commit 93ff94186a

@ -744,7 +744,12 @@ public extension MessageViewModel {
) AND
\(quote[.timestampMs]) = \(interaction[.timestampMs])
)
LEFT JOIN \(InteractionAttachment.self) ON \(interaction[.id]) = \(interactionAttachment[.interactionId])
LEFT JOIN \(InteractionAttachment.self) ON \(interactionAttachment[.attachmentId]) = (
SELECT \(interactionAttachment[.attachmentId])
FROM \(InteractionAttachment.self)
WHERE \(interaction[.id]) = \(interactionAttachment[.interactionId])
LIMIT 1
)
) AS \(ViewModel.quoteKey) ON \(quote[.interactionId]) = \(interaction[.id])
LEFT JOIN \(Attachment.self) AS \(ViewModel.quoteAttachmentKey) ON \(ViewModel.quoteAttachmentKey).\(attachmentIdColumnLiteral) = \(quote[.attachmentId])
LEFT JOIN \(LinkPreview.self) ON (

Loading…
Cancel
Save