Skip to content

Commit e56f527

Browse files
committed
dump the latest libxmtp
1 parent 76a231d commit e56f527

File tree

1 file changed

+144
-3
lines changed

1 file changed

+144
-3
lines changed

library/src/main/java/xmtpv3.kt

+144-3
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,8 @@ internal interface _UniFFILib : Library {
411411
): Long
412412
fun uniffi_xmtpv3_fn_method_ffigroup_find_messages(`ptr`: Pointer,`opts`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
413413
): RustBuffer.ByValue
414+
fun uniffi_xmtpv3_fn_method_ffigroup_group_metadata(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
415+
): Pointer
414416
fun uniffi_xmtpv3_fn_method_ffigroup_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
415417
): RustBuffer.ByValue
416418
fun uniffi_xmtpv3_fn_method_ffigroup_is_active(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
@@ -425,6 +427,14 @@ internal interface _UniFFILib : Library {
425427
): Pointer
426428
fun uniffi_xmtpv3_fn_method_ffigroup_sync(`ptr`: Pointer,
427429
): Pointer
430+
fun uniffi_xmtpv3_fn_free_ffigroupmetadata(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
431+
): Unit
432+
fun uniffi_xmtpv3_fn_method_ffigroupmetadata_conversation_type(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
433+
): RustBuffer.ByValue
434+
fun uniffi_xmtpv3_fn_method_ffigroupmetadata_creator_account_address(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
435+
): RustBuffer.ByValue
436+
fun uniffi_xmtpv3_fn_method_ffigroupmetadata_policy_type(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
437+
): RustBuffer.ByValue
428438
fun uniffi_xmtpv3_fn_free_ffistreamcloser(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
429439
): Unit
430440
fun uniffi_xmtpv3_fn_method_ffistreamcloser_end(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
@@ -655,6 +665,8 @@ internal interface _UniFFILib : Library {
655665
): Short
656666
fun uniffi_xmtpv3_checksum_method_ffigroup_find_messages(
657667
): Short
668+
fun uniffi_xmtpv3_checksum_method_ffigroup_group_metadata(
669+
): Short
658670
fun uniffi_xmtpv3_checksum_method_ffigroup_id(
659671
): Short
660672
fun uniffi_xmtpv3_checksum_method_ffigroup_is_active(
@@ -669,6 +681,12 @@ internal interface _UniFFILib : Library {
669681
): Short
670682
fun uniffi_xmtpv3_checksum_method_ffigroup_sync(
671683
): Short
684+
fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type(
685+
): Short
686+
fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_account_address(
687+
): Short
688+
fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_policy_type(
689+
): Short
672690
fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end(
673691
): Short
674692
fun uniffi_xmtpv3_checksum_method_ffistreamcloser_is_closed(
@@ -789,6 +807,9 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
789807
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_find_messages() != 61973.toShort()) {
790808
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
791809
}
810+
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_group_metadata() != 3690.toShort()) {
811+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
812+
}
792813
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_id() != 35243.toShort()) {
793814
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
794815
}
@@ -810,6 +831,15 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
810831
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_sync() != 9422.toShort()) {
811832
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
812833
}
834+
if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type() != 37015.toShort()) {
835+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
836+
}
837+
if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_account_address() != 1906.toShort()) {
838+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
839+
}
840+
if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_policy_type() != 22845.toShort()) {
841+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
842+
}
813843
if (lib.uniffi_xmtpv3_checksum_method_ffistreamcloser_end() != 47211.toShort()) {
814844
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
815845
}
@@ -1398,7 +1428,8 @@ public interface FfiGroupInterface {
13981428
@Throws(GenericException::class)
13991429
suspend fun `addMembers`(`accountAddresses`: List<String>)
14001430
fun `createdAtNs`(): Long@Throws(GenericException::class)
1401-
fun `findMessages`(`opts`: FfiListMessagesOptions): List<FfiMessage>
1431+
fun `findMessages`(`opts`: FfiListMessagesOptions): List<FfiMessage>@Throws(GenericException::class)
1432+
fun `groupMetadata`(): FfiGroupMetadata
14021433
fun `id`(): ByteArray@Throws(GenericException::class)
14031434
fun `isActive`(): Boolean@Throws(GenericException::class)
14041435
fun `listMembers`(): List<FfiGroupMember>@Throws(GenericException::class)
@@ -1471,6 +1502,18 @@ class FfiGroup(
14711502
FfiConverterSequenceTypeFfiMessage.lift(it)
14721503
}
14731504

1505+
1506+
@Throws(GenericException::class)override fun `groupMetadata`(): FfiGroupMetadata =
1507+
callWithPointer {
1508+
rustCallWithError(GenericException) { _status ->
1509+
_UniFFILib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_metadata(it,
1510+
1511+
_status)
1512+
}
1513+
}.let {
1514+
FfiConverterTypeFfiGroupMetadata.lift(it)
1515+
}
1516+
14741517
override fun `id`(): ByteArray =
14751518
callWithPointer {
14761519
rustCall() { _status ->
@@ -1621,6 +1664,98 @@ public object FfiConverterTypeFfiGroup: FfiConverter<FfiGroup, Pointer> {
16211664

16221665

16231666

1667+
public interface FfiGroupMetadataInterface {
1668+
1669+
fun `conversationType`(): String
1670+
fun `creatorAccountAddress`(): String@Throws(GenericException::class)
1671+
fun `policyType`(): GroupPermissions
1672+
companion object
1673+
}
1674+
1675+
class FfiGroupMetadata(
1676+
pointer: Pointer
1677+
) : FFIObject(pointer), FfiGroupMetadataInterface {
1678+
1679+
/**
1680+
* Disconnect the object from the underlying Rust object.
1681+
*
1682+
* It can be called more than once, but once called, interacting with the object
1683+
* causes an `IllegalStateException`.
1684+
*
1685+
* Clients **must** call this method once done with the object, or cause a memory leak.
1686+
*/
1687+
override protected fun freeRustArcPtr() {
1688+
rustCall() { status ->
1689+
_UniFFILib.INSTANCE.uniffi_xmtpv3_fn_free_ffigroupmetadata(this.pointer, status)
1690+
}
1691+
}
1692+
1693+
override fun `conversationType`(): String =
1694+
callWithPointer {
1695+
rustCall() { _status ->
1696+
_UniFFILib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroupmetadata_conversation_type(it,
1697+
1698+
_status)
1699+
}
1700+
}.let {
1701+
FfiConverterString.lift(it)
1702+
}
1703+
1704+
override fun `creatorAccountAddress`(): String =
1705+
callWithPointer {
1706+
rustCall() { _status ->
1707+
_UniFFILib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroupmetadata_creator_account_address(it,
1708+
1709+
_status)
1710+
}
1711+
}.let {
1712+
FfiConverterString.lift(it)
1713+
}
1714+
1715+
1716+
@Throws(GenericException::class)override fun `policyType`(): GroupPermissions =
1717+
callWithPointer {
1718+
rustCallWithError(GenericException) { _status ->
1719+
_UniFFILib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroupmetadata_policy_type(it,
1720+
1721+
_status)
1722+
}
1723+
}.let {
1724+
FfiConverterTypeGroupPermissions.lift(it)
1725+
}
1726+
1727+
1728+
1729+
1730+
companion object
1731+
1732+
}
1733+
1734+
public object FfiConverterTypeFfiGroupMetadata: FfiConverter<FfiGroupMetadata, Pointer> {
1735+
override fun lower(value: FfiGroupMetadata): Pointer = value.callWithPointer { it }
1736+
1737+
override fun lift(value: Pointer): FfiGroupMetadata {
1738+
return FfiGroupMetadata(value)
1739+
}
1740+
1741+
override fun read(buf: ByteBuffer): FfiGroupMetadata {
1742+
// The Rust code always writes pointers as 8 bytes, and will
1743+
// fail to compile if they don't fit.
1744+
return lift(Pointer(buf.getLong()))
1745+
}
1746+
1747+
override fun allocationSize(value: FfiGroupMetadata) = 8
1748+
1749+
override fun write(value: FfiGroupMetadata, buf: ByteBuffer) {
1750+
// The Rust code always expects pointers written as 8 bytes,
1751+
// and will fail to compile if they don't fit.
1752+
buf.putLong(Pointer.nativeValue(lower(value)))
1753+
}
1754+
}
1755+
1756+
1757+
1758+
16241759
public interface FfiStreamCloserInterface {
16251760

16261761
fun `end`()
@@ -2547,6 +2682,7 @@ sealed class GenericException(message: String): Exception(message) {
25472682
class ApiException(message: String) : GenericException(message)
25482683
class GroupException(message: String) : GenericException(message)
25492684
class Signature(message: String) : GenericException(message)
2685+
class GroupMetadata(message: String) : GenericException(message)
25502686
class Generic(message: String) : GenericException(message)
25512687

25522688

@@ -2565,7 +2701,8 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer<GenericExcep
25652701
4 -> GenericException.ApiException(FfiConverterString.read(buf))
25662702
5 -> GenericException.GroupException(FfiConverterString.read(buf))
25672703
6 -> GenericException.Signature(FfiConverterString.read(buf))
2568-
7 -> GenericException.Generic(FfiConverterString.read(buf))
2704+
7 -> GenericException.GroupMetadata(FfiConverterString.read(buf))
2705+
8 -> GenericException.Generic(FfiConverterString.read(buf))
25692706
else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
25702707
}
25712708

@@ -2601,10 +2738,14 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer<GenericExcep
26012738
buf.putInt(6)
26022739
Unit
26032740
}
2604-
is GenericException.Generic -> {
2741+
is GenericException.GroupMetadata -> {
26052742
buf.putInt(7)
26062743
Unit
26072744
}
2745+
is GenericException.Generic -> {
2746+
buf.putInt(8)
2747+
Unit
2748+
}
26082749
}.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
26092750
}
26102751

0 commit comments

Comments
 (0)