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

Group message delivery status #232

Merged
merged 6 commits into from
Apr 18, 2024
Merged

Group message delivery status #232

merged 6 commits into from
Apr 18, 2024

Conversation

nplasterer
Copy link
Contributor

@nplasterer nplasterer commented Apr 18, 2024

Part of xmtp/libxmtp#516

  • Add enum field for delivery status that maps to ffi
  • Expose delivery status on messages
  • Expose delivery status filtering on find_messages
  • Expose message id on send

@nplasterer nplasterer self-assigned this Apr 18, 2024
@nplasterer nplasterer marked this pull request as ready for review April 18, 2024 05:07
@nplasterer nplasterer requested a review from a team as a code owner April 18, 2024 05:07
@nplasterer nplasterer requested a review from richardhuaaa April 18, 2024 05:08
@@ -12,6 +13,7 @@ data class DecodedMessage(
var encodedContent: Content.EncodedContent,
var senderAddress: String,
var sent: Date,
var deliveryStatus: MessageDeliveryStatus = MessageDeliveryStatus.PUBLISHED
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V2 messages default to published.

@@ -330,9 +331,11 @@ class GroupTest {
fun testCanSendMessageToGroup() {
val group = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress)) }
runBlocking { group.send("howdy") }
runBlocking { group.send("gm") }
val messageId = runBlocking { group.send("gm") }
runBlocking { group.sync() }
assertEquals(group.messages().first().body, "gm")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the group.send("gm") was here prior and now grabbing the messageId. However, I'm confused by how the subsequent equality test passed in the first place. Wouldn't this be the second message in the group? Asking to understand rather than request changes. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messages come in descending order by default since the last message is the first message you want to see.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow! That's great to know. Thanks for sharing.

Copy link
Contributor

@zombieobject zombieobject left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature addition to the SDK! 🚀

@nplasterer nplasterer merged commit e6a7bfe into main Apr 18, 2024
5 of 6 checks passed
@nplasterer nplasterer deleted the np/message-delivery-status branch April 18, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants