Skip to content

Commit

Permalink
Small tweaks to make sentAtNs (#323)
Browse files Browse the repository at this point in the history
* return sent at ns in the decoded message

* dry run what the release number will be

* confirm dry run ran correctly
  • Loading branch information
nplasterer authored Nov 10, 2024
1 parent 1b263b7 commit fb35fad
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
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
15 changes: 1 addition & 14 deletions library/src/main/java/org/xmtp/android/library/DecodedMessage.kt
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

0 comments on commit fb35fad

Please sign in to comment.