|
|
@ -81,25 +81,13 @@ class VisibleMessage : Message() {
|
|
|
|
// Text
|
|
|
|
// Text
|
|
|
|
text?.let { dataMessage.body = text }
|
|
|
|
text?.let { dataMessage.body = text }
|
|
|
|
// Quote
|
|
|
|
// Quote
|
|
|
|
val quotedAttachmentID = quote?.attachmentID
|
|
|
|
|
|
|
|
quotedAttachmentID?.let {
|
|
|
|
|
|
|
|
val index = attachmentIDs.indexOf(quotedAttachmentID)
|
|
|
|
|
|
|
|
if (index >= 0) { attachmentIDs.removeAt(index) }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
val quote = quote
|
|
|
|
|
|
|
|
quote?.let {
|
|
|
|
quote?.let {
|
|
|
|
val quoteProto = quote.toProto()
|
|
|
|
val quoteProto = it.toProto()
|
|
|
|
if (quoteProto != null) dataMessage.quote = quoteProto
|
|
|
|
if (quoteProto != null) dataMessage.quote = quoteProto
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//Link preview
|
|
|
|
//Link preview
|
|
|
|
val linkPreviewAttachmentID = linkPreview?.attachmentID
|
|
|
|
|
|
|
|
linkPreviewAttachmentID?.let {
|
|
|
|
|
|
|
|
val index = attachmentIDs.indexOf(quotedAttachmentID)
|
|
|
|
|
|
|
|
if (index >= 0) { attachmentIDs.removeAt(index) }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
val linkPreview = linkPreview
|
|
|
|
|
|
|
|
linkPreview?.let {
|
|
|
|
linkPreview?.let {
|
|
|
|
val linkPreviewProto = linkPreview.toProto()
|
|
|
|
val linkPreviewProto = it.toProto()
|
|
|
|
linkPreviewProto?.let {
|
|
|
|
linkPreviewProto?.let {
|
|
|
|
dataMessage.addAllPreview(listOf(linkPreviewProto))
|
|
|
|
dataMessage.addAllPreview(listOf(linkPreviewProto))
|
|
|
|
}
|
|
|
|
}
|
|
|
|