feat: deal with quoted text

pull/655/head
Ryan Zhao 3 years ago
parent bedf3ab44b
commit 8ba7f927d8

@ -457,7 +457,7 @@ final class VisibleMessageCell: MessageCell, UITextViewDelegate, BodyTextViewDel
let quoteView: QuoteView = QuoteView( let quoteView: QuoteView = QuoteView(
for: .regular, for: .regular,
authorId: quote.authorId, authorId: quote.authorId,
quotedText: quote.body, quotedText: quote.body ?? "QUOTED_MESSAGE_NOT_FOUND".localized(),
threadVariant: cellViewModel.threadVariant, threadVariant: cellViewModel.threadVariant,
currentUserPublicKey: cellViewModel.currentUserPublicKey, currentUserPublicKey: cellViewModel.currentUserPublicKey,
currentUserBlindedPublicKey: cellViewModel.currentUserBlindedPublicKey, currentUserBlindedPublicKey: cellViewModel.currentUserBlindedPublicKey,

@ -660,11 +660,12 @@ public extension MessageViewModel {
SELECT \(quote[.interactionId]), SELECT \(quote[.interactionId]),
\(quote[.authorId]), \(quote[.authorId]),
\(quote[.timestampMs]), \(quote[.timestampMs]),
\(interaction[.body]) AS \(Quote.Columns.body),
\(quote[.attachmentId])
FROM \(Quote.self) FROM \(Quote.self)
LEFT JOIN ( LEFT JOIN \(Interaction.self) ON (
SELECT \(interaction[.authorId]), \(quote[.authorId]) = \(interaction[.authorId]) AND
\(interaction[.timestampMs]), \(quote[.timestampMs]) = \(interaction[.timestampMs])
\(interaction[.body])
) )
) AS \(ViewModel.quoteKey) ON \(quote[.interactionId]) = \(interaction[.id]) ) AS \(ViewModel.quoteKey) ON \(quote[.interactionId]) = \(interaction[.id])
LEFT JOIN \(Attachment.self) AS \(ViewModel.quoteAttachmentKey) ON \(ViewModel.quoteAttachmentKey).\(attachmentIdColumnLiteral) = \(quote[.attachmentId]) LEFT JOIN \(Attachment.self) AS \(ViewModel.quoteAttachmentKey) ON \(ViewModel.quoteAttachmentKey).\(attachmentIdColumnLiteral) = \(quote[.attachmentId])

Loading…
Cancel
Save