Skip to content

Commit

Permalink
expose the type
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Nov 15, 2024
1 parent 078f32b commit c54698e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 6 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: ae7a267d
Version: 29a955a1
Branch: main
Date: 2024-11-07 20:55:17 +0000
Date: 2024-11-14 22:21:21 +0000
62 changes: 58 additions & 4 deletions library/src/main/java/xmtpv3.kt
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): RustBuffer.ByValue

fun uniffi_xmtpv3_fn_method_fficonversation_conversation_type(
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): RustBuffer.ByValue

fun uniffi_xmtpv3_fn_method_fficonversation_created_at_ns(
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): Long
Expand Down Expand Up @@ -1843,6 +1847,9 @@ internal interface UniffiLib : Library {
fun uniffi_xmtpv3_checksum_method_fficonversation_consent_state(
): Short

fun uniffi_xmtpv3_checksum_method_fficonversation_conversation_type(
): Short

fun uniffi_xmtpv3_checksum_method_fficonversation_created_at_ns(
): Short

Expand Down Expand Up @@ -2223,6 +2230,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_xmtpv3_checksum_method_fficonversation_consent_state() != 25033.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_fficonversation_conversation_type() != 16402.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_fficonversation_created_at_ns() != 17973.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -2322,7 +2332,7 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_xmtpv3_checksum_method_fficonversationcallback_on_error() != 461.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_fficonversationmetadata_conversation_type() != 48024.toShort()) {
if (lib.uniffi_xmtpv3_checksum_method_fficonversationmetadata_conversation_type() != 22241.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_fficonversationmetadata_creator_inbox_id() != 61067.toShort()) {
Expand Down Expand Up @@ -2977,6 +2987,8 @@ public interface FfiConversationInterface {

fun `consentState`(): FfiConsentState

fun `conversationType`(): FfiConversationType

fun `createdAtNs`(): kotlin.Long

fun `dmPeerInboxId`(): kotlin.String
Expand Down Expand Up @@ -3308,6 +3320,20 @@ open class FfiConversation : Disposable, AutoCloseable, FfiConversationInterface
}


@Throws(GenericException::class)
override fun `conversationType`(): FfiConversationType {
return FfiConverterTypeFfiConversationType.lift(
callWithPointer {
uniffiRustCallWithError(GenericException) { _status ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversation_conversation_type(
it, _status
)
}
}
)
}


override fun `createdAtNs`(): kotlin.Long {
return FfiConverterLong.lift(
callWithPointer {
Expand Down Expand Up @@ -4497,7 +4523,7 @@ public object FfiConverterTypeFfiConversationCallback :

public interface FfiConversationMetadataInterface {

fun `conversationType`(): kotlin.String
fun `conversationType`(): FfiConversationType

fun `creatorInboxId`(): kotlin.String

Expand Down Expand Up @@ -4585,8 +4611,8 @@ open class FfiConversationMetadata : Disposable, AutoCloseable, FfiConversationM
}
}

override fun `conversationType`(): kotlin.String {
return FfiConverterString.lift(
override fun `conversationType`(): FfiConversationType {
return FfiConverterTypeFfiConversationType.lift(
callWithPointer {
uniffiRustCall() { _status ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversationmetadata_conversation_type(
Expand Down Expand Up @@ -9307,6 +9333,34 @@ public object FfiConverterTypeFfiConversationMessageKind :
}


enum class FfiConversationType {

GROUP,
DM,
SYNC;

companion object
}


/**
* @suppress
*/
public object FfiConverterTypeFfiConversationType : FfiConverterRustBuffer<FfiConversationType> {
override fun read(buf: ByteBuffer) = try {
FfiConversationType.values()[buf.getInt() - 1]
} catch (e: IndexOutOfBoundsException) {
throw RuntimeException("invalid enum value, something is very wrong!!", e)
}

override fun allocationSize(value: FfiConversationType) = 4UL

override fun write(value: FfiConversationType, buf: ByteBuffer) {
buf.putInt(value.ordinal + 1)
}
}


enum class FfiDeliveryStatus {

UNPUBLISHED,
Expand Down

0 comments on commit c54698e

Please sign in to comment.