diff --git a/library/src/main/java/org/xmtp/android/library/ConversationV2.kt b/library/src/main/java/org/xmtp/android/library/ConversationV2.kt index 3f6e610e4..6d20253c6 100644 --- a/library/src/main/java/org/xmtp/android/library/ConversationV2.kt +++ b/library/src/main/java/org/xmtp/android/library/ConversationV2.kt @@ -30,6 +30,7 @@ data class ConversationV2( val context: Invitation.InvitationV1.Context, val peerAddress: String, val client: Client, + val createdAtNs: Long? = null, private val header: SealedInvitationHeaderV1, ) { @@ -50,12 +51,13 @@ data class ConversationV2( context = invitation.context, peerAddress = peerAddress, client = client, + createdAtNs = header.createdNs, header = header, ) } } - val createdAt: Date = Date(header.createdNs / 1_000_000) + val createdAt: Date = Date((createdAtNs ?: header.createdNs) / 1_000_000) /** * This lists messages sent to the [Conversation]. diff --git a/library/src/main/java/org/xmtp/android/library/Conversations.kt b/library/src/main/java/org/xmtp/android/library/Conversations.kt index 51c897026..71edc7b37 100644 --- a/library/src/main/java/org/xmtp/android/library/Conversations.kt +++ b/library/src/main/java/org/xmtp/android/library/Conversations.kt @@ -226,6 +226,7 @@ data class Conversations( context = data.invitation.context, peerAddress = data.peerAddress, client = client, + createdAtNs = data.createdNs, header = Invitation.SealedInvitationHeaderV1.getDefaultInstance(), ), )