mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
fix sending quote
This commit is contained in:
parent
0a7fecfb52
commit
82b8883bb1
@ -84,8 +84,7 @@ class Quote() {
|
||||
}
|
||||
val quotedAttachmentProto = SignalServiceProtos.DataMessage.Quote.QuotedAttachment.newBuilder()
|
||||
quotedAttachmentProto.contentType = attachment.contentType
|
||||
val fileName = attachment.fileName?.get()
|
||||
fileName?.let { quotedAttachmentProto.fileName = fileName }
|
||||
if (attachment.fileName.isPresent) quotedAttachmentProto.fileName = attachment.fileName.get()
|
||||
quotedAttachmentProto.thumbnail = Attachment.createAttachmentPointer(attachment)
|
||||
try {
|
||||
quoteProto.addAttachments(quotedAttachmentProto.build())
|
||||
|
@ -81,25 +81,13 @@ class VisibleMessage : Message() {
|
||||
// Text
|
||||
text?.let { dataMessage.body = text }
|
||||
// Quote
|
||||
val quotedAttachmentID = quote?.attachmentID
|
||||
quotedAttachmentID?.let {
|
||||
val index = attachmentIDs.indexOf(quotedAttachmentID)
|
||||
if (index >= 0) { attachmentIDs.removeAt(index) }
|
||||
}
|
||||
val quote = quote
|
||||
quote?.let {
|
||||
val quoteProto = quote.toProto()
|
||||
val quoteProto = it.toProto()
|
||||
if (quoteProto != null) dataMessage.quote = quoteProto
|
||||
}
|
||||
//Link preview
|
||||
val linkPreviewAttachmentID = linkPreview?.attachmentID
|
||||
linkPreviewAttachmentID?.let {
|
||||
val index = attachmentIDs.indexOf(quotedAttachmentID)
|
||||
if (index >= 0) { attachmentIDs.removeAt(index) }
|
||||
}
|
||||
val linkPreview = linkPreview
|
||||
linkPreview?.let {
|
||||
val linkPreviewProto = linkPreview.toProto()
|
||||
val linkPreviewProto = it.toProto()
|
||||
linkPreviewProto?.let {
|
||||
dataMessage.addAllPreview(listOf(linkPreviewProto))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user