mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 14:18:26 +00:00
clean
This commit is contained in:
parent
1407d1ca97
commit
c758619f13
@ -29,11 +29,11 @@ public data class OpenGroupMessage(
|
|||||||
// Validation
|
// Validation
|
||||||
if (!message.isValid()) { return null } // Should be valid at this point
|
if (!message.isValid()) { return null } // Should be valid at this point
|
||||||
// Quote
|
// Quote
|
||||||
val quote: OpenGroupMessage.Quote? = {
|
val quote: Quote? = {
|
||||||
val quote = message.quote
|
val quote = message.quote
|
||||||
if (quote != null && quote.isValid()) {
|
if (quote != null && quote.isValid()) {
|
||||||
val quotedMessageServerID = storage.getQuoteServerID(quote.id, quote.publicKey)
|
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 {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
@ -47,8 +47,8 @@ public data class OpenGroupMessage(
|
|||||||
linkPreview?.let {
|
linkPreview?.let {
|
||||||
if (!linkPreview.isValid()) { return@let }
|
if (!linkPreview.isValid()) { return@let }
|
||||||
val attachment = linkPreview.getImage() ?: return@let
|
val attachment = linkPreview.getImage() ?: return@let
|
||||||
val openGroupLinkPreview = OpenGroupMessage.Attachment(
|
val openGroupLinkPreview = Attachment(
|
||||||
OpenGroupMessage.Attachment.Kind.LinkPreview,
|
Attachment.Kind.LinkPreview,
|
||||||
server,
|
server,
|
||||||
attachment.getId(),
|
attachment.getId(),
|
||||||
attachment.getContentType(),
|
attachment.getContentType(),
|
||||||
@ -59,14 +59,14 @@ public data class OpenGroupMessage(
|
|||||||
attachment.getHeight(),
|
attachment.getHeight(),
|
||||||
attachment.getCaption(),
|
attachment.getCaption(),
|
||||||
attachment.getUrl(),
|
attachment.getUrl(),
|
||||||
linkPreview.getUrl(),
|
linkPreview.url,
|
||||||
linkPreview.getTitle())
|
linkPreview.title)
|
||||||
result.attachments.add(openGroupLinkPreview)
|
result.attachments.add(openGroupLinkPreview)
|
||||||
}
|
}
|
||||||
// Attachments
|
// Attachments
|
||||||
val attachments = message.getAttachemnts().forEach {
|
val attachments = message.getAttachemnts().forEach {
|
||||||
val attachement = OpenGroupMessage.Attachment(
|
val attachement = Attachment(
|
||||||
OpenGroupMessage.Attachment.Kind.Attachment,
|
Attachment.Kind.Attachment,
|
||||||
server,
|
server,
|
||||||
it.getId(),
|
it.getId(),
|
||||||
it.getContentType(),
|
it.getContentType(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user