diff --git a/buildSrc/src/main/kotlin/BuildVersionsSDK.kt b/buildSrc/src/main/kotlin/BuildVersionsSDK.kt index c77488b..c79a78b 100644 --- a/buildSrc/src/main/kotlin/BuildVersionsSDK.kt +++ b/buildSrc/src/main/kotlin/BuildVersionsSDK.kt @@ -1,5 +1,5 @@ object BuildVersionsSDK { const val majorVersion = 0 const val minorVersion = 2 - const val patchVersion = 68 + const val patchVersion = 69 } diff --git a/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt b/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt index 5504932..436ba71 100644 --- a/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt +++ b/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt @@ -2171,6 +2171,8 @@ internal open class UniffiVTableCallbackInterfaceWidgetCapabilitiesProvider( + + @@ -2683,6 +2685,8 @@ internal interface UniffiLib : Library { ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_membership(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue + fun uniffi_matrix_sdk_ffi_fn_method_room_message_filtered_timeline(`ptr`: Pointer,`internalIdPrefix`: RustBuffer.ByValue,`allowedMessageTypes`: RustBuffer.ByValue, + ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_own_user_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_room_pinned_events_timeline(`ptr`: Pointer,`internalIdPrefix`: RustBuffer.ByValue,`maxEventsToLoad`: Short,`maxConcurrentRequests`: Short, @@ -3745,6 +3749,8 @@ internal interface UniffiLib : Library { ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_membership( ): Short + fun uniffi_matrix_sdk_ffi_checksum_method_room_message_filtered_timeline( + ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_own_user_id( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_pinned_events_timeline( @@ -4809,6 +4815,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_membership() != 26065.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_message_filtered_timeline() != 47862.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_own_user_id() != 39510.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -12495,6 +12504,24 @@ public interface RoomInterface { fun `membership`(): Membership + /** + * A timeline instance that can be configured to only include RoomMessage + * type events and filter those further based on their message type. + * + * Virtual timeline items will still be provided and the + * `default_event_filter` will be applied before everything else. + * + * # Arguments + * + * * `internal_id_prefix` - An optional String that will be prepended to + * all the timeline item's internal IDs, making it possible to + * distinguish different timeline instances from each other. + * + * * `allowed_message_types` - A list of `RoomMessageEventMessageType` that + * will be allowed to appear in the timeline + */ + suspend fun `messageFilteredTimeline`(`internalIdPrefix`: kotlin.String?, `allowedMessageTypes`: List): Timeline + fun `ownUserId`(): kotlin.String suspend fun `pinnedEventsTimeline`(`internalIdPrefix`: kotlin.String?, `maxEventsToLoad`: kotlin.UShort, `maxConcurrentRequests`: kotlin.UShort): Timeline @@ -13713,6 +13740,43 @@ open class Room: Disposable, AutoCloseable, RoomInterface { } + + /** + * A timeline instance that can be configured to only include RoomMessage + * type events and filter those further based on their message type. + * + * Virtual timeline items will still be provided and the + * `default_event_filter` will be applied before everything else. + * + * # Arguments + * + * * `internal_id_prefix` - An optional String that will be prepended to + * all the timeline item's internal IDs, making it possible to + * distinguish different timeline instances from each other. + * + * * `allowed_message_types` - A list of `RoomMessageEventMessageType` that + * will be allowed to appear in the timeline + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `messageFilteredTimeline`(`internalIdPrefix`: kotlin.String?, `allowedMessageTypes`: List) : Timeline { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_message_filtered_timeline( + thisPtr, + FfiConverterOptionalString.lower(`internalIdPrefix`),FfiConverterSequenceTypeRoomMessageEventMessageType.lower(`allowedMessageTypes`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeTimeline.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + override fun `ownUserId`(): kotlin.String { return FfiConverterString.lift( callWithPointer { @@ -32715,6 +32779,42 @@ public object FfiConverterTypeRoomListServiceSyncIndicator: FfiConverterRustBuff + +enum class RoomMessageEventMessageType { + + AUDIO, + EMOTE, + FILE, + IMAGE, + LOCATION, + NOTICE, + SERVER_NOTICE, + TEXT, + VIDEO, + VERIFICATION_REQUEST, + OTHER; + companion object +} + + +public object FfiConverterTypeRoomMessageEventMessageType: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + RoomMessageEventMessageType.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } + + override fun allocationSize(value: RoomMessageEventMessageType) = 4UL + + override fun write(value: RoomMessageEventMessageType, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) + } +} + + + + + /** * Enum representing the push notification modes for a room. */ @@ -38429,6 +38529,31 @@ public object FfiConverterSequenceTypeRoomListEntriesUpdate: FfiConverterRustBuf +public object FfiConverterSequenceTypeRoomMessageEventMessageType: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeRoomMessageEventMessageType.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeRoomMessageEventMessageType.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeRoomMessageEventMessageType.write(it, buf) + } + } +} + + + + public object FfiConverterSequenceTypeSlidingSyncVersion: FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() diff --git a/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_crypto/matrix_sdk_crypto.kt b/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_crypto/matrix_sdk_crypto.kt index dd1c63b..4e21ef4 100644 --- a/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_crypto/matrix_sdk_crypto.kt +++ b/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_crypto/matrix_sdk_crypto.kt @@ -1421,7 +1421,22 @@ enum class UtdCause { * be confused with pre-join or pre-invite messages (see * [`UtdCause::SentBeforeWeJoined`] for that). */ - HISTORICAL_MESSAGE; + HISTORICAL_MESSAGE, + /** + * The keys for this event are intentionally withheld. + * + * The sender has refused to share the key because our device does not meet + * the sender's security requirements. + */ + WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE, + /** + * The keys for this event are missing, likely because the sender was + * unable to share them (e.g., failure to establish an Olm 1:1 + * channel). Alternatively, the sender may have deliberately excluded + * this device by cherry-picking and blocking it, in which case, no action + * can be taken on our side. + */ + WITHHELD_BY_SENDER; companion object }