Skip to content

Commit

Permalink
Bump SDK version to 0.2.0 (matrix-rust-sdk to 5cb587a60b14cabc8fc5521…
Browse files Browse the repository at this point in the history
…c33832bca416f6bd8)
  • Loading branch information
github-actions committed Feb 12, 2024
1 parent 726c770 commit 1c37711
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 189 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/BuildVersionsSDK.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object BuildVersionsSDK {
const val majorVersion = 0
const val minorVersion = 1
const val patchVersion = 99
const val minorVersion = 2
const val patchVersion = 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ import uniffi.matrix_sdk.FfiConverterTypeRoomMemberRole
import uniffi.matrix_sdk.FfiConverterTypeRoomPowerLevelChanges
import uniffi.matrix_sdk.RoomMemberRole
import uniffi.matrix_sdk.RoomPowerLevelChanges
import uniffi.matrix_sdk_base.FfiConverterTypeRoomNotableTags
import uniffi.matrix_sdk_base.RoomNotableTags
import uniffi.matrix_sdk_ui.BackPaginationStatus
import uniffi.matrix_sdk_ui.EventItemOrigin
import uniffi.matrix_sdk_ui.FfiConverterTypeBackPaginationStatus
import uniffi.matrix_sdk_ui.FfiConverterTypeEventItemOrigin
import uniffi.matrix_sdk.RustBuffer as RustBufferRoomMemberRole
import uniffi.matrix_sdk.RustBuffer as RustBufferRoomPowerLevelChanges
import uniffi.matrix_sdk_base.RustBuffer as RustBufferRoomNotableTags
import uniffi.matrix_sdk_ui.RustBuffer as RustBufferBackPaginationStatus
import uniffi.matrix_sdk_ui.RustBuffer as RustBufferEventItemOrigin

Expand Down Expand Up @@ -414,7 +411,6 @@ internal interface UniffiLib : Library {
uniffiCallbackInterfaceRoomListLoadingStateListener.register(lib)
uniffiCallbackInterfaceRoomListServiceStateListener.register(lib)
uniffiCallbackInterfaceRoomListServiceSyncIndicatorListener.register(lib)
uniffiCallbackInterfaceRoomNotableTagsListener.register(lib)
uniffiCallbackInterfaceSessionVerificationControllerDelegate.register(lib)
uniffiCallbackInterfaceSyncServiceStateObserver.register(lib)
uniffiCallbackInterfaceTimelineListener.register(lib)
Expand Down Expand Up @@ -825,16 +821,14 @@ internal interface UniffiLib : Library {
): Unit
fun uniffi_matrix_sdk_ffi_fn_method_room_room_info(`ptr`: Pointer,
): Pointer
fun uniffi_matrix_sdk_ffi_fn_method_room_set_is_favorite(`ptr`: Pointer,`isFavorite`: Byte,`tagOrder`: RustBuffer.ByValue,
fun uniffi_matrix_sdk_ffi_fn_method_room_set_is_favourite(`ptr`: Pointer,`isFavourite`: Byte,`tagOrder`: RustBuffer.ByValue,
): Pointer
fun uniffi_matrix_sdk_ffi_fn_method_room_set_is_low_priority(`ptr`: Pointer,`isLowPriority`: Byte,`tagOrder`: RustBuffer.ByValue,
): Pointer
fun uniffi_matrix_sdk_ffi_fn_method_room_set_name(`ptr`: Pointer,`name`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
): Unit
fun uniffi_matrix_sdk_ffi_fn_method_room_set_topic(`ptr`: Pointer,`topic`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
): Unit
fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_notable_tags(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus,
): Pointer
fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_room_info_updates(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus,
): Pointer
fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_typing_notifications(`ptr`: Pointer,`listener`: Long,
Expand Down Expand Up @@ -1213,8 +1207,6 @@ internal interface UniffiLib : Library {
): Unit
fun uniffi_matrix_sdk_ffi_fn_init_callback_roomlistservicesyncindicatorlistener(`handle`: ForeignCallback,
): Unit
fun uniffi_matrix_sdk_ffi_fn_init_callback_roomnotabletagslistener(`handle`: ForeignCallback,
): Unit
fun uniffi_matrix_sdk_ffi_fn_init_callback_sessionverificationcontrollerdelegate(`handle`: ForeignCallback,
): Unit
fun uniffi_matrix_sdk_ffi_fn_init_callback_syncservicestateobserver(`handle`: ForeignCallback,
Expand Down Expand Up @@ -1727,16 +1719,14 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_room_info(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_set_is_favorite(
fun uniffi_matrix_sdk_ffi_checksum_method_room_set_is_favourite(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_set_is_low_priority(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_set_name(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_set_topic(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_notable_tags(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_room_info_updates(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_typing_notifications(
Expand Down Expand Up @@ -2037,8 +2027,6 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_roomlistservicesyncindicatorlistener_on_update(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_roomnotabletagslistener_call(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_accept_verification_request(
): Short
fun uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_start_sas_verification(
Expand Down Expand Up @@ -2616,7 +2604,7 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_room_info() != 41146.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_set_is_favorite() != 61829.toShort()) {
if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_set_is_favourite() != 41879.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_set_is_low_priority() != 47223.toShort()) {
Expand All @@ -2628,9 +2616,6 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_set_topic() != 29413.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_notable_tags() != 3691.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_room_info_updates() != 47774.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -3081,9 +3066,6 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservicesyncindicatorlistener_on_update() != 42394.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomnotabletagslistener_call() != 33153.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_accept_verification_request() != 22759.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -7019,7 +7001,7 @@ public interface RoomInterface {

suspend fun `roomInfo`(): RoomInfo

suspend fun `setIsFavorite`(`isFavorite`: Boolean, `tagOrder`: Double?)
suspend fun `setIsFavourite`(`isFavourite`: Boolean, `tagOrder`: Double?)

suspend fun `setIsLowPriority`(`isLowPriority`: Boolean, `tagOrder`: Double?)

Expand All @@ -7033,8 +7015,6 @@ public interface RoomInterface {
*/
fun `setTopic`(`topic`: String)

fun `subscribeToNotableTags`(`listener`: RoomNotableTagsListener): TaskHandle

fun `subscribeToRoomInfoUpdates`(`listener`: RoomInfoListener): TaskHandle

suspend fun `subscribeToTypingNotifications`(`listener`: TypingNotificationsListener): TaskHandle
Expand Down Expand Up @@ -7874,12 +7854,12 @@ open class Room : FFIObject, RoomInterface {

@Throws(ClientException::class)
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
override suspend fun `setIsFavorite`(`isFavorite`: Boolean, `tagOrder`: Double?) {
override suspend fun `setIsFavourite`(`isFavourite`: Boolean, `tagOrder`: Double?) {
return uniffiRustCallAsync(
callWithPointer { thisPtr ->
UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_set_is_favorite(
UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_set_is_favourite(
thisPtr,
FfiConverterBoolean.lower(`isFavorite`),FfiConverterOptionalDouble.lower(`tagOrder`),
FfiConverterBoolean.lower(`isFavourite`),FfiConverterOptionalDouble.lower(`tagOrder`),
)
},
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) },
Expand Down Expand Up @@ -7941,17 +7921,6 @@ open class Room : FFIObject, RoomInterface {
}


override fun `subscribeToNotableTags`(`listener`: RoomNotableTagsListener): TaskHandle =
callWithPointer {
uniffiRustCall() { _status ->
UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_notable_tags(it,
FfiConverterTypeRoomNotableTagsListener.lower(`listener`),
_status)
}
}.let {
FfiConverterTypeTaskHandle.lift(it)
}

override fun `subscribeToRoomInfoUpdates`(`listener`: RoomInfoListener): TaskHandle =
callWithPointer {
uniffiRustCall() { _status ->
Expand Down Expand Up @@ -21180,93 +21149,6 @@ public object FfiConverterTypeRoomListServiceSyncIndicatorListener: FfiConverter



public interface RoomNotableTagsListener {

fun `call`(`notableTags`: RoomNotableTags)

companion object
}



// Implement the foreign callback handler for RoomNotableTagsListener
internal class UniffiCallbackInterfaceRoomNotableTagsListener : ForeignCallback {
@Suppress("TooGenericExceptionCaught")
override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int {
val cb = FfiConverterTypeRoomNotableTagsListener.handleMap.get(handle)
return when (method) {
IDX_CALLBACK_FREE -> {
FfiConverterTypeRoomNotableTagsListener.handleMap.remove(handle)

// Successful return
// See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs`
UNIFFI_CALLBACK_SUCCESS
}
1 -> {
// Call the method, write to outBuf and return a status code
// See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs` for info
try {
this.`invokeCall`(cb, argsData, argsLen, outBuf)
} catch (e: Throwable) {
// Unexpected error
try {
// Try to serialize the error into a string
outBuf.setValue(FfiConverterString.lower(e.toString()))
} catch (e: Throwable) {
// If that fails, then it's time to give up and just return
}
UNIFFI_CALLBACK_UNEXPECTED_ERROR
}
}

else -> {
// An unexpected error happened.
// See docs of ForeignCallback in `uniffi_core/src/ffi/foreigncallbacks.rs`
try {
// Try to serialize the error into a string
outBuf.setValue(FfiConverterString.lower("Invalid Callback index"))
} catch (e: Throwable) {
// If that fails, then it's time to give up and just return
}
UNIFFI_CALLBACK_UNEXPECTED_ERROR
}
}
}


@Suppress("UNUSED_PARAMETER")
private fun `invokeCall`(kotlinCallbackInterface: RoomNotableTagsListener, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int {
val argsBuf = argsData.getByteBuffer(0, argsLen.toLong()).also {
it.order(ByteOrder.BIG_ENDIAN)
}
fun makeCall() : Int {
kotlinCallbackInterface.`call`(
FfiConverterTypeRoomNotableTags.read(argsBuf)
)
return UNIFFI_CALLBACK_SUCCESS
}
fun makeCallAndHandleError() : Int = makeCall()

return makeCallAndHandleError()
}


// Registers the foreign callback with the Rust side.
// This method is generated for each callback interface.
internal fun register(lib: UniffiLib) {
lib.uniffi_matrix_sdk_ffi_fn_init_callback_roomnotabletagslistener(this)
}
}

internal val uniffiCallbackInterfaceRoomNotableTagsListener = UniffiCallbackInterfaceRoomNotableTagsListener()

// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust.
public object FfiConverterTypeRoomNotableTagsListener: FfiConverterCallbackInterface<RoomNotableTagsListener>()





public interface SessionVerificationControllerDelegate {

fun `didAcceptVerificationRequest`()
Expand Down Expand Up @@ -23963,10 +23845,6 @@ public object FfiConverterMapStringSequenceString: FfiConverterRustBuffer<Map<St










Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,26 +548,6 @@ inline fun <T : Disposable?, R> T.use(block: (T) -> R) =
}
}

public object FfiConverterBoolean: FfiConverter<Boolean, Byte> {
override fun lift(value: Byte): Boolean {
return value.toInt() != 0
}

override fun read(buf: ByteBuffer): Boolean {
return lift(buf.get())
}

override fun lower(value: Boolean): Byte {
return if (value) 1.toByte() else 0.toByte()
}

override fun allocationSize(value: Boolean) = 1

override fun write(value: Boolean, buf: ByteBuffer) {
buf.put(lower(value))
}
}

public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
// Note: we don't inherit from FfiConverterRustBuffer, because we use a
// special encoding when lowering/lifting. We can use `RustBuffer.len` to
Expand Down Expand Up @@ -622,41 +602,3 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
}
}



/**
* Holds information computed from the room account data `m.tag` events.
*/
data class RoomNotableTags (
/**
* Whether or not the room is marked as favorite.
*/
var `isFavorite`: Boolean,
/**
* Whether or not the room is marked as low priority.
*/
var `isLowPriority`: Boolean
) {

companion object
}

public object FfiConverterTypeRoomNotableTags: FfiConverterRustBuffer<RoomNotableTags> {
override fun read(buf: ByteBuffer): RoomNotableTags {
return RoomNotableTags(
FfiConverterBoolean.read(buf),
FfiConverterBoolean.read(buf),
)
}

override fun allocationSize(value: RoomNotableTags) = (
FfiConverterBoolean.allocationSize(value.`isFavorite`) +
FfiConverterBoolean.allocationSize(value.`isLowPriority`)
)

override fun write(value: RoomNotableTags, buf: ByteBuffer) {
FfiConverterBoolean.write(value.`isFavorite`, buf)
FfiConverterBoolean.write(value.`isLowPriority`, buf)
}
}

0 comments on commit 1c37711

Please sign in to comment.