From c758619f1399f429d071a46b66a799182cdf08b5 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Wed, 2 Dec 2020 17:10:45 +1100 Subject: [PATCH] clean --- .../messaging/opengroups/OpenGroupMessage.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt index 1647997a0e..6472a9f1b1 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/opengroups/OpenGroupMessage.kt @@ -29,11 +29,11 @@ public data class OpenGroupMessage( // Validation if (!message.isValid()) { return null } // Should be valid at this point // Quote - val quote: OpenGroupMessage.Quote? = { + val quote: Quote? = { val quote = message.quote if (quote != null && quote.isValid()) { val quotedMessageServerID = storage.getQuoteServerID(quote.id, quote.publicKey) - OpenGroupMessage.Quote(quote.timestamp, quote.publicKey, quote.text, quotedMessageServerID) + Quote(quote.timestamp!!, quote.publicKey!!, quote.text!!, quotedMessageServerID) } else { null } @@ -47,8 +47,8 @@ public data class OpenGroupMessage( linkPreview?.let { if (!linkPreview.isValid()) { return@let } val attachment = linkPreview.getImage() ?: return@let - val openGroupLinkPreview = OpenGroupMessage.Attachment( - OpenGroupMessage.Attachment.Kind.LinkPreview, + val openGroupLinkPreview = Attachment( + Attachment.Kind.LinkPreview, server, attachment.getId(), attachment.getContentType(), @@ -59,14 +59,14 @@ public data class OpenGroupMessage( attachment.getHeight(), attachment.getCaption(), attachment.getUrl(), - linkPreview.getUrl(), - linkPreview.getTitle()) + linkPreview.url, + linkPreview.title) result.attachments.add(openGroupLinkPreview) } // Attachments val attachments = message.getAttachemnts().forEach { - val attachement = OpenGroupMessage.Attachment( - OpenGroupMessage.Attachment.Kind.Attachment, + val attachement = Attachment( + Attachment.Kind.Attachment, server, it.getId(), it.getContentType(),