Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tweaks to make sentAtNs #323

Merged
merged 3 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
uses: mathieudutour/[email protected]
with:
release_branches: "release"
custom_tag: 3.0.1
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <T> content(): T? =
encodedContent.decoded()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading