Skip to content

Commit

Permalink
V3 DMs stage zero (#303)
Browse files Browse the repository at this point in the history
* update the bindings

* update the library as well'
  • Loading branch information
nplasterer authored Oct 1, 2024
1 parent 1bc5bdc commit 78a3a0b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 4f529aeb
Version: bb7a38f7
Branch: main
Date: 2024-09-26 04:05:26 +0000
Date: 2024-10-01 18:08:33 +0000
44 changes: 44 additions & 0 deletions library/src/main/java/xmtpv3.kt
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): Unit

fun uniffi_xmtpv3_fn_method_fficonversations_create_dm(
`ptr`: Pointer, `accountAddress`: RustBuffer.ByValue,
): Long

fun uniffi_xmtpv3_fn_method_fficonversations_create_group(
`ptr`: Pointer, `accountAddresses`: RustBuffer.ByValue, `opts`: RustBuffer.ByValue,
): Long
Expand Down Expand Up @@ -1663,6 +1667,9 @@ internal interface UniffiLib : Library {
fun uniffi_xmtpv3_checksum_func_verify_k256_sha256(
): Short

fun uniffi_xmtpv3_checksum_method_fficonversations_create_dm(
): Short

fun uniffi_xmtpv3_checksum_method_fficonversations_create_group(
): Short

Expand Down Expand Up @@ -1998,6 +2005,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_xmtpv3_checksum_func_verify_k256_sha256() != 25521.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_fficonversations_create_dm() != 61687.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_fficonversations_create_group() != 62996.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -2682,6 +2692,8 @@ private class JavaLangRefCleanable(

public interface FfiConversationsInterface {

suspend fun `createDm`(`accountAddress`: kotlin.String): FfiGroup

suspend fun `createGroup`(
`accountAddresses`: List<kotlin.String>,
`opts`: FfiCreateGroupOptions,
Expand Down Expand Up @@ -2784,6 +2796,38 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa
}


@Throws(GenericException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `createDm`(`accountAddress`: kotlin.String): FfiGroup {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_create_dm(
thisPtr,
FfiConverterString.lower(`accountAddress`),
)
},
{ future, callback, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(
future,
callback,
continuation
)
},
{ future, continuation ->
UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(
future,
continuation
)
},
{ future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) },
// lift function
{ FfiConverterTypeFfiGroup.lift(it) },
// Error FFI converter
GenericException.ErrorHandler,
)
}


@Throws(GenericException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `createGroup`(
Expand Down
Binary file modified library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/x86/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so
Binary file not shown.

0 comments on commit 78a3a0b

Please sign in to comment.