diff --git a/library/src/main/java/org/xmtp/android/library/DecodedMessage.kt b/library/src/main/java/org/xmtp/android/library/DecodedMessage.kt index dda478e8e..fa0358f48 100644 --- a/library/src/main/java/org/xmtp/android/library/DecodedMessage.kt +++ b/library/src/main/java/org/xmtp/android/library/DecodedMessage.kt @@ -1,6 +1,5 @@ package org.xmtp.android.library -import org.xmtp.android.library.codecs.TextCodec import org.xmtp.android.library.codecs.decoded import org.xmtp.android.library.libxmtp.Message.MessageDeliveryStatus import org.xmtp.proto.message.contents.Content @@ -13,21 +12,9 @@ data class DecodedMessage( var encodedContent: Content.EncodedContent, var senderAddress: String, var sent: Date, + var sentNs: Long, var deliveryStatus: MessageDeliveryStatus = MessageDeliveryStatus.PUBLISHED ) { - companion object { - fun preview(client: Client, topic: String, body: String, senderAddress: String, sent: Date): DecodedMessage { - val encoded = TextCodec().encode(content = body) - return DecodedMessage( - client = client, - topic = topic, - encodedContent = encoded, - senderAddress = senderAddress, - sent = sent - ) - } - } - fun content(): T? = encodedContent.decoded() diff --git a/library/src/main/java/org/xmtp/android/library/libxmtp/Message.kt b/library/src/main/java/org/xmtp/android/library/libxmtp/Message.kt index 0511e50f5..6374a211c 100644 --- a/library/src/main/java/org/xmtp/android/library/libxmtp/Message.kt +++ b/library/src/main/java/org/xmtp/android/library/libxmtp/Message.kt @@ -54,6 +54,7 @@ data class Message(val client: Client, private val libXMTPMessage: FfiMessage) { encodedContent = EncodedContent.parseFrom(libXMTPMessage.content), senderAddress = senderInboxId, sent = sentAt, + sentNs = sentAtNs, deliveryStatus = deliveryStatus ) if (decodedMessage.encodedContent.type == ContentTypeGroupUpdated && libXMTPMessage.kind != FfiConversationMessageKind.MEMBERSHIP_CHANGE) {