diff --git a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt index 440572860..cdcec72cd 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt @@ -84,8 +84,8 @@ class GroupTest { alixGroup.addMembers(listOf(caro.walletAddress)) boGroup.sync() } - assertEquals(alixGroup.members(alixClient).size, 3) - assertEquals(boGroup.members(boClient).size, 3) + assertEquals(alixGroup.members().size, 3) + assertEquals(boGroup.members().size, 3) // All members also defaults remove to admin only now. assertThrows(XMTPException::class.java) { @@ -95,8 +95,8 @@ class GroupTest { } } - assertEquals(alixGroup.members(alixClient).size, 3) - assertEquals(boGroup.members(boClient).size, 3) + assertEquals(alixGroup.members().size, 3) + assertEquals(boGroup.members().size, 3) assertEquals(boGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Allow) assertEquals(alixGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Allow) @@ -135,31 +135,31 @@ class GroupTest { alixGroup.sync() } - assertEquals(alixGroup.members(alixClient).size, 3) - assertEquals(boGroup.members(boClient).size, 3) + assertEquals(alixGroup.members().size, 3) + assertEquals(boGroup.members().size, 3) assertThrows(XMTPException::class.java) { runBlocking { alixGroup.removeMembers(listOf(caro.walletAddress)) } } runBlocking { boGroup.sync() } - assertEquals(alixGroup.members(alixClient).size, 3) - assertEquals(boGroup.members(boClient).size, 3) + assertEquals(alixGroup.members().size, 3) + assertEquals(boGroup.members().size, 3) runBlocking { boGroup.removeMembers(listOf(caro.walletAddress)) alixGroup.sync() } - assertEquals(alixGroup.members(alixClient).size, 2) - assertEquals(boGroup.members(boClient).size, 2) + assertEquals(alixGroup.members().size, 2) + assertEquals(boGroup.members().size, 2) assertThrows(XMTPException::class.java) { runBlocking { alixGroup.addMembers(listOf(caro.walletAddress)) } } runBlocking { boGroup.sync() } - assertEquals(alixGroup.members(alixClient).size, 2) - assertEquals(boGroup.members(boClient).size, 2) + assertEquals(alixGroup.members().size, 2) + assertEquals(boGroup.members().size, 2) assertEquals(boGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Admin) assertEquals(alixGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Admin) @@ -183,7 +183,7 @@ class GroupTest { ) } assertEquals( - group.members(boClient).map { it.inboxId }.sorted(), + group.members().map { it.inboxId }.sorted(), listOf( caroClient.inboxId, alixClient.inboxId, @@ -291,7 +291,7 @@ class GroupTest { boGroup.sync() } assertEquals( - boGroup.members(boClient).map { it.inboxId }.sorted(), + boGroup.members().map { it.inboxId }.sorted(), listOf( alixClient.inboxId, boClient.inboxId @@ -303,7 +303,7 @@ class GroupTest { val group = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress)) } runBlocking { group.addMembersByInboxId(listOf(caroClient.inboxId)) } assertEquals( - group.members(boClient).map { it.inboxId }.sorted(), + group.members().map { it.inboxId }.sorted(), listOf( caroClient.inboxId, alixClient.inboxId, @@ -324,7 +324,7 @@ class GroupTest { } runBlocking { group.removeMembersByInboxId(listOf(caroClient.inboxId)) } assertEquals( - group.members(boClient).map { it.inboxId }.sorted(), + group.members().map { it.inboxId }.sorted(), listOf( alixClient.inboxId, boClient.inboxId diff --git a/library/src/main/java/libxmtp-version.txt b/library/src/main/java/libxmtp-version.txt index 561bf0f66..e188c0c23 100644 --- a/library/src/main/java/libxmtp-version.txt +++ b/library/src/main/java/libxmtp-version.txt @@ -1,3 +1,3 @@ -Version: cd0fc5cb +Version: 4f529aeb Branch: main -Date: 2024-09-20 15:05:17 +0000 +Date: 2024-09-26 04:05:26 +0000 diff --git a/library/src/main/java/xmtpv3.kt b/library/src/main/java/xmtpv3.kt index 707ea5294..f4ee4ec8c 100644 --- a/library/src/main/java/xmtpv3.kt +++ b/library/src/main/java/xmtpv3.kt @@ -7094,7 +7094,7 @@ public object FfiConverterTypeFfiGroupMember : FfiConverterRustBuffer, + var `installations`: List, var `accountAddresses`: List, ) { @@ -7106,7 +7106,7 @@ public object FfiConverterTypeFfiInboxState : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiInstallation { + return FfiInstallation( + FfiConverterByteArray.read(buf), + FfiConverterOptionalULong.read(buf), + ) + } + + override fun allocationSize(value: FfiInstallation) = ( + FfiConverterByteArray.allocationSize(value.`id`) + + FfiConverterOptionalULong.allocationSize(value.`clientTimestampNs`) + ) + + override fun write(value: FfiInstallation, buf: ByteBuffer) { + FfiConverterByteArray.write(value.`id`, buf) + FfiConverterOptionalULong.write(value.`clientTimestampNs`, buf) + } +} + + data class FfiListConversationsOptions( var `createdAfterNs`: kotlin.Long?, var `createdBeforeNs`: kotlin.Long?, @@ -8221,6 +8249,33 @@ public object FfiConverterTypeFfiV2SubscriptionCallback : FfiConverterCallbackInterface() +public object FfiConverterOptionalULong : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): kotlin.ULong? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterULong.read(buf) + } + + override fun allocationSize(value: kotlin.ULong?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterULong.allocationSize(value) + } + } + + override fun write(value: kotlin.ULong?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterULong.write(value, buf) + } + } +} + + public object FfiConverterOptionalLong : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): kotlin.Long? { if (buf.get().toInt() == 0) { @@ -8634,6 +8689,30 @@ public object FfiConverterSequenceTypeFfiGroupMember : } +public object FfiConverterSequenceTypeFfiInstallation : + FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeFfiInstallation.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeFfiInstallation.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeFfiInstallation.write(it, buf) + } + } +} + + public object FfiConverterSequenceTypeFfiMessage : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt()