@@ -401,6 +401,8 @@ internal interface _UniFFILib : Library {
401
401
): Pointer
402
402
fun uniffi_xmtpv3_fn_method_fficonversations_stream (`ptr`: Pointer ,`callback`: Long ,
403
403
): Pointer
404
+ fun uniffi_xmtpv3_fn_method_fficonversations_stream_all_messages (`ptr`: Pointer ,`messageCallback`: Long ,
405
+ ): Pointer
404
406
fun uniffi_xmtpv3_fn_method_fficonversations_sync (`ptr`: Pointer ,
405
407
): Pointer
406
408
fun uniffi_xmtpv3_fn_free_ffigroup (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
@@ -411,6 +413,8 @@ internal interface _UniFFILib : Library {
411
413
): Long
412
414
fun uniffi_xmtpv3_fn_method_ffigroup_find_messages (`ptr`: Pointer ,`opts`: RustBuffer .ByValue ,_uniffi_out_err : RustCallStatus ,
413
415
): RustBuffer .ByValue
416
+ fun uniffi_xmtpv3_fn_method_ffigroup_group_metadata (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
417
+ ): Pointer
414
418
fun uniffi_xmtpv3_fn_method_ffigroup_id (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
415
419
): RustBuffer .ByValue
416
420
fun uniffi_xmtpv3_fn_method_ffigroup_is_active (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
@@ -425,6 +429,14 @@ internal interface _UniFFILib : Library {
425
429
): Pointer
426
430
fun uniffi_xmtpv3_fn_method_ffigroup_sync (`ptr`: Pointer ,
427
431
): Pointer
432
+ fun uniffi_xmtpv3_fn_free_ffigroupmetadata (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
433
+ ): Unit
434
+ fun uniffi_xmtpv3_fn_method_ffigroupmetadata_conversation_type (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
435
+ ): RustBuffer .ByValue
436
+ fun uniffi_xmtpv3_fn_method_ffigroupmetadata_creator_account_address (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
437
+ ): RustBuffer .ByValue
438
+ fun uniffi_xmtpv3_fn_method_ffigroupmetadata_policy_type (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
439
+ ): RustBuffer .ByValue
428
440
fun uniffi_xmtpv3_fn_free_ffistreamcloser (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
429
441
): Unit
430
442
fun uniffi_xmtpv3_fn_method_ffistreamcloser_end (`ptr`: Pointer ,_uniffi_out_err : RustCallStatus ,
@@ -647,6 +659,8 @@ internal interface _UniFFILib : Library {
647
659
): Short
648
660
fun uniffi_xmtpv3_checksum_method_fficonversations_stream (
649
661
): Short
662
+ fun uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages (
663
+ ): Short
650
664
fun uniffi_xmtpv3_checksum_method_fficonversations_sync (
651
665
): Short
652
666
fun uniffi_xmtpv3_checksum_method_ffigroup_add_members (
@@ -655,6 +669,8 @@ internal interface _UniFFILib : Library {
655
669
): Short
656
670
fun uniffi_xmtpv3_checksum_method_ffigroup_find_messages (
657
671
): Short
672
+ fun uniffi_xmtpv3_checksum_method_ffigroup_group_metadata (
673
+ ): Short
658
674
fun uniffi_xmtpv3_checksum_method_ffigroup_id (
659
675
): Short
660
676
fun uniffi_xmtpv3_checksum_method_ffigroup_is_active (
@@ -669,6 +685,12 @@ internal interface _UniFFILib : Library {
669
685
): Short
670
686
fun uniffi_xmtpv3_checksum_method_ffigroup_sync (
671
687
): Short
688
+ fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type (
689
+ ): Short
690
+ fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_account_address (
691
+ ): Short
692
+ fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_policy_type (
693
+ ): Short
672
694
fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end (
673
695
): Short
674
696
fun uniffi_xmtpv3_checksum_method_ffistreamcloser_is_closed (
@@ -777,6 +799,9 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
777
799
if (lib.uniffi_xmtpv3_checksum_method_fficonversations_stream() != 60583 .toShort()) {
778
800
throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
779
801
}
802
+ if (lib.uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages() != 65211 .toShort()) {
803
+ throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
804
+ }
780
805
if (lib.uniffi_xmtpv3_checksum_method_fficonversations_sync() != 62598 .toShort()) {
781
806
throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
782
807
}
@@ -789,6 +814,9 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
789
814
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_find_messages() != 61973 .toShort()) {
790
815
throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
791
816
}
817
+ if (lib.uniffi_xmtpv3_checksum_method_ffigroup_group_metadata() != 3690 .toShort()) {
818
+ throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
819
+ }
792
820
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_id() != 35243 .toShort()) {
793
821
throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
794
822
}
@@ -810,6 +838,15 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
810
838
if (lib.uniffi_xmtpv3_checksum_method_ffigroup_sync() != 9422 .toShort()) {
811
839
throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
812
840
}
841
+ if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type() != 37015 .toShort()) {
842
+ throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
843
+ }
844
+ if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_account_address() != 1906 .toShort()) {
845
+ throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
846
+ }
847
+ if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_policy_type() != 22845 .toShort()) {
848
+ throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
849
+ }
813
850
if (lib.uniffi_xmtpv3_checksum_method_ffistreamcloser_end() != 47211 .toShort()) {
814
851
throw RuntimeException (" UniFFI API checksum mismatch: try cleaning and rebuilding your project" )
815
852
}
@@ -1259,6 +1296,7 @@ public interface FfiConversationsInterface {
1259
1296
suspend fun `createGroup` (`accountAddresses`: List <String >, `permissions`: GroupPermissions ? ): FfiGroup @Throws (GenericException ::class)
1260
1297
suspend fun `list` (`opts`: FfiListConversationsOptions ): List <FfiGroup >@Throws (GenericException ::class)
1261
1298
suspend fun `stream` (`callback`: FfiConversationCallback ): FfiStreamCloser @Throws (GenericException ::class)
1299
+ suspend fun `streamAllMessages` (`messageCallback`: FfiMessageCallback ): FfiStreamCloser @Throws (GenericException ::class)
1262
1300
suspend fun `sync` ()
1263
1301
companion object
1264
1302
}
@@ -1342,6 +1380,26 @@ class FfiConversations(
1342
1380
)
1343
1381
}
1344
1382
1383
+ @Throws(GenericException ::class )
1384
+ @Suppress(" ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE" )
1385
+ override suspend fun `streamAllMessages` (`messageCallback`: FfiMessageCallback ) : FfiStreamCloser {
1386
+ return uniffiRustCallAsync(
1387
+ callWithPointer { thisPtr ->
1388
+ _UniFFILib .INSTANCE .uniffi_xmtpv3_fn_method_fficonversations_stream_all_messages(
1389
+ thisPtr,
1390
+ FfiConverterTypeFfiMessageCallback .lower(`messageCallback`),
1391
+ )
1392
+ },
1393
+ { future, continuation -> _UniFFILib .INSTANCE .ffi_xmtpv3_rust_future_poll_pointer(future, continuation) },
1394
+ { future, continuation -> _UniFFILib .INSTANCE .ffi_xmtpv3_rust_future_complete_pointer(future, continuation) },
1395
+ { future -> _UniFFILib .INSTANCE .ffi_xmtpv3_rust_future_free_pointer(future) },
1396
+ // lift function
1397
+ { FfiConverterTypeFfiStreamCloser .lift(it) },
1398
+ // Error FFI converter
1399
+ GenericException .ErrorHandler ,
1400
+ )
1401
+ }
1402
+
1345
1403
@Throws(GenericException ::class )
1346
1404
@Suppress(" ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE" )
1347
1405
override suspend fun `sync` () {
@@ -1398,7 +1456,8 @@ public interface FfiGroupInterface {
1398
1456
@Throws(GenericException ::class )
1399
1457
suspend fun `addMembers` (`accountAddresses`: List <String >)
1400
1458
fun `createdAtNs` (): Long @Throws (GenericException ::class)
1401
- fun `findMessages` (`opts`: FfiListMessagesOptions ): List <FfiMessage >
1459
+ fun `findMessages` (`opts`: FfiListMessagesOptions ): List <FfiMessage >@Throws (GenericException ::class)
1460
+ fun `groupMetadata` (): FfiGroupMetadata
1402
1461
fun `id` (): ByteArray @Throws (GenericException ::class)
1403
1462
fun `isActive` (): Boolean @Throws (GenericException ::class)
1404
1463
fun `listMembers` (): List <FfiGroupMember >@Throws (GenericException ::class)
@@ -1471,6 +1530,18 @@ class FfiGroup(
1471
1530
FfiConverterSequenceTypeFfiMessage .lift(it)
1472
1531
}
1473
1532
1533
+
1534
+ @Throws(GenericException ::class )override fun `groupMetadata` (): FfiGroupMetadata =
1535
+ callWithPointer {
1536
+ rustCallWithError(GenericException ) { _status ->
1537
+ _UniFFILib .INSTANCE .uniffi_xmtpv3_fn_method_ffigroup_group_metadata(it,
1538
+
1539
+ _status )
1540
+ }
1541
+ }.let {
1542
+ FfiConverterTypeFfiGroupMetadata .lift(it)
1543
+ }
1544
+
1474
1545
override fun `id` (): ByteArray =
1475
1546
callWithPointer {
1476
1547
rustCall() { _status ->
@@ -1621,6 +1692,98 @@ public object FfiConverterTypeFfiGroup: FfiConverter<FfiGroup, Pointer> {
1621
1692
1622
1693
1623
1694
1695
+ public interface FfiGroupMetadataInterface {
1696
+
1697
+ fun `conversationType` (): String
1698
+ fun `creatorAccountAddress` (): String @Throws (GenericException ::class)
1699
+ fun `policyType` (): GroupPermissions
1700
+ companion object
1701
+ }
1702
+
1703
+ class FfiGroupMetadata (
1704
+ pointer : Pointer
1705
+ ) : FFIObject(pointer), FfiGroupMetadataInterface {
1706
+
1707
+ /* *
1708
+ * Disconnect the object from the underlying Rust object.
1709
+ *
1710
+ * It can be called more than once, but once called, interacting with the object
1711
+ * causes an `IllegalStateException`.
1712
+ *
1713
+ * Clients **must** call this method once done with the object, or cause a memory leak.
1714
+ */
1715
+ override protected fun freeRustArcPtr () {
1716
+ rustCall() { status ->
1717
+ _UniFFILib .INSTANCE .uniffi_xmtpv3_fn_free_ffigroupmetadata(this .pointer, status)
1718
+ }
1719
+ }
1720
+
1721
+ override fun `conversationType` (): String =
1722
+ callWithPointer {
1723
+ rustCall() { _status ->
1724
+ _UniFFILib .INSTANCE .uniffi_xmtpv3_fn_method_ffigroupmetadata_conversation_type(it,
1725
+
1726
+ _status )
1727
+ }
1728
+ }.let {
1729
+ FfiConverterString .lift(it)
1730
+ }
1731
+
1732
+ override fun `creatorAccountAddress` (): String =
1733
+ callWithPointer {
1734
+ rustCall() { _status ->
1735
+ _UniFFILib .INSTANCE .uniffi_xmtpv3_fn_method_ffigroupmetadata_creator_account_address(it,
1736
+
1737
+ _status )
1738
+ }
1739
+ }.let {
1740
+ FfiConverterString .lift(it)
1741
+ }
1742
+
1743
+
1744
+ @Throws(GenericException ::class )override fun `policyType` (): GroupPermissions =
1745
+ callWithPointer {
1746
+ rustCallWithError(GenericException ) { _status ->
1747
+ _UniFFILib .INSTANCE .uniffi_xmtpv3_fn_method_ffigroupmetadata_policy_type(it,
1748
+
1749
+ _status )
1750
+ }
1751
+ }.let {
1752
+ FfiConverterTypeGroupPermissions .lift(it)
1753
+ }
1754
+
1755
+
1756
+
1757
+
1758
+ companion object
1759
+
1760
+ }
1761
+
1762
+ public object FfiConverterTypeFfiGroupMetadata: FfiConverter<FfiGroupMetadata, Pointer> {
1763
+ override fun lower (value : FfiGroupMetadata ): Pointer = value.callWithPointer { it }
1764
+
1765
+ override fun lift (value : Pointer ): FfiGroupMetadata {
1766
+ return FfiGroupMetadata (value)
1767
+ }
1768
+
1769
+ override fun read (buf : ByteBuffer ): FfiGroupMetadata {
1770
+ // The Rust code always writes pointers as 8 bytes, and will
1771
+ // fail to compile if they don't fit.
1772
+ return lift(Pointer (buf.getLong()))
1773
+ }
1774
+
1775
+ override fun allocationSize (value : FfiGroupMetadata ) = 8
1776
+
1777
+ override fun write (value : FfiGroupMetadata , buf : ByteBuffer ) {
1778
+ // The Rust code always expects pointers written as 8 bytes,
1779
+ // and will fail to compile if they don't fit.
1780
+ buf.putLong(Pointer .nativeValue(lower(value)))
1781
+ }
1782
+ }
1783
+
1784
+
1785
+
1786
+
1624
1787
public interface FfiStreamCloserInterface {
1625
1788
1626
1789
fun `end` ()
@@ -2547,6 +2710,7 @@ sealed class GenericException(message: String): Exception(message) {
2547
2710
class ApiException (message : String ) : GenericException(message)
2548
2711
class GroupException (message : String ) : GenericException(message)
2549
2712
class Signature (message : String ) : GenericException(message)
2713
+ class GroupMetadata (message : String ) : GenericException(message)
2550
2714
class Generic (message : String ) : GenericException(message)
2551
2715
2552
2716
@@ -2565,7 +2729,8 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer<GenericExcep
2565
2729
4 -> GenericException .ApiException (FfiConverterString .read(buf))
2566
2730
5 -> GenericException .GroupException (FfiConverterString .read(buf))
2567
2731
6 -> GenericException .Signature (FfiConverterString .read(buf))
2568
- 7 -> GenericException .Generic (FfiConverterString .read(buf))
2732
+ 7 -> GenericException .GroupMetadata (FfiConverterString .read(buf))
2733
+ 8 -> GenericException .Generic (FfiConverterString .read(buf))
2569
2734
else -> throw RuntimeException (" invalid error enum value, something is very wrong!!" )
2570
2735
}
2571
2736
@@ -2601,10 +2766,14 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer<GenericExcep
2601
2766
buf.putInt(6 )
2602
2767
Unit
2603
2768
}
2604
- is GenericException .Generic -> {
2769
+ is GenericException .GroupMetadata -> {
2605
2770
buf.putInt(7 )
2606
2771
Unit
2607
2772
}
2773
+ is GenericException .Generic -> {
2774
+ buf.putInt(8 )
2775
+ Unit
2776
+ }
2608
2777
}.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
2609
2778
}
2610
2779
0 commit comments