|
|
|
@ -265,6 +265,24 @@ public class ConversationViewModel: OWSAudioPlayerDelegate {
|
|
|
|
|
.allCases
|
|
|
|
|
.filter { $0 != .wasRead }
|
|
|
|
|
),
|
|
|
|
|
PagedData.ObservedChanges(
|
|
|
|
|
table: Attachment.self,
|
|
|
|
|
columns: [.state],
|
|
|
|
|
joinToPagedType: {
|
|
|
|
|
let interaction: TypedTableAlias<Interaction> = TypedTableAlias()
|
|
|
|
|
let linkPreview: TypedTableAlias<LinkPreview> = TypedTableAlias()
|
|
|
|
|
let linkPreviewAttachment: TypedTableAlias<Attachment> = TypedTableAlias()
|
|
|
|
|
|
|
|
|
|
return SQL("""
|
|
|
|
|
LEFT JOIN \(LinkPreview.self) ON (
|
|
|
|
|
\(linkPreview[.url]) = \(interaction[.linkPreviewUrl]) AND
|
|
|
|
|
\(Interaction.linkPreviewFilterLiteral())
|
|
|
|
|
)
|
|
|
|
|
LEFT JOIN \(linkPreviewAttachment) ON \(linkPreviewAttachment[.id]) = \(linkPreview[.attachmentId])
|
|
|
|
|
"""
|
|
|
|
|
)
|
|
|
|
|
}()
|
|
|
|
|
),
|
|
|
|
|
PagedData.ObservedChanges(
|
|
|
|
|
table: Contact.self,
|
|
|
|
|
columns: [.isTrusted],
|
|
|
|
|