fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v26.03.23 (#6444)
* fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v26.03.23 * Fix `RoomInfo` test fixture * Add `activeCallIntentConsensus` to `RoomInfo` --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
@@ -14,6 +14,7 @@ import io.element.android.features.invite.api.acceptdecline.AcceptDeclineInviteS
|
||||
import io.element.android.features.invite.api.acceptdecline.anAcceptDeclineInviteState
|
||||
import io.element.android.libraries.architecture.AsyncAction
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.room.CallIntentConsensus
|
||||
import io.element.android.libraries.matrix.api.room.CurrentUserMembership
|
||||
import io.element.android.libraries.matrix.api.room.RoomInfo
|
||||
import io.element.android.libraries.matrix.api.room.history.RoomHistoryVisibility
|
||||
@@ -137,6 +138,7 @@ private fun aSpaceInfo(
|
||||
roomVersion = "11",
|
||||
privilegedCreatorRole = false,
|
||||
isLowPriority = false,
|
||||
activeCallIntentConsensus = CallIntentConsensus.None,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ test_detekt_test = { module = "io.gitlab.arturbosch.detekt:detekt-test", version
|
||||
# https://github.com/matrix-org/matrix-rust-components-kotlin/commits/main/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt
|
||||
# All new features should not be implemented in the pull request that upgrades the version, developers should
|
||||
# only fix API breaks and may add some TODOs.
|
||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:26.03.19"
|
||||
matrix_sdk = "org.matrix.rustcomponents:sdk-android:26.03.23"
|
||||
|
||||
# Others
|
||||
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api.room
|
||||
|
||||
import io.element.android.libraries.matrix.api.notification.CallIntent
|
||||
|
||||
/**
|
||||
* Represents the consensus state of [CallIntent] among room members.
|
||||
* Call members can advertise their intent to use audio or video, clients can
|
||||
* use this in the UI and also to decide to start camera or not when joining.
|
||||
*
|
||||
* This enum distinguishes between full consensus (all members advertise and
|
||||
* agree), partial consensus (only some members advertise, but those who do
|
||||
* agree), and no consensus (either no one advertises or advertisers disagree).
|
||||
*/
|
||||
sealed interface CallIntentConsensus {
|
||||
/**
|
||||
* All members advertise and agree on the same [callIntent].
|
||||
*/
|
||||
data class Full(val callIntent: CallIntent) : CallIntentConsensus
|
||||
|
||||
/**
|
||||
* Some members advertise and agree on the same [callIntent], but not all of them.
|
||||
*/
|
||||
data class Partial(
|
||||
/** The call intent that the agreeing members have advertised. */
|
||||
val callIntent: CallIntent,
|
||||
/** The number of members who advertise and agree on the same [callIntent]. */
|
||||
val agreeingCount: Int,
|
||||
/** The total number of members in the call. */
|
||||
val totalCount: Int,
|
||||
) : CallIntentConsensus
|
||||
|
||||
/**
|
||||
* No consensus. No one advertises or advertisers disagree.
|
||||
*/
|
||||
data object None : CallIntentConsensus
|
||||
}
|
||||
@@ -77,6 +77,7 @@ data class RoomInfo(
|
||||
val roomVersion: String?,
|
||||
val privilegedCreatorRole: Boolean,
|
||||
val isLowPriority: Boolean,
|
||||
val activeCallIntentConsensus: CallIntentConsensus,
|
||||
) {
|
||||
val aliases: List<RoomAlias>
|
||||
get() = listOfNotNull(canonicalAlias) + alternativeAliases
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.impl.room
|
||||
|
||||
import io.element.android.libraries.matrix.api.notification.CallIntent
|
||||
import io.element.android.libraries.matrix.api.room.CallIntentConsensus
|
||||
import org.matrix.rustcomponents.sdk.RtcCallIntent
|
||||
import org.matrix.rustcomponents.sdk.RtcCallIntentConsensus
|
||||
|
||||
fun RtcCallIntentConsensus.map(): CallIntentConsensus = when (this) {
|
||||
is RtcCallIntentConsensus.Full -> CallIntentConsensus.Full(v1.map())
|
||||
is RtcCallIntentConsensus.Partial -> CallIntentConsensus.Partial(
|
||||
callIntent = intent.map(),
|
||||
agreeingCount = agreeingCount.toInt(),
|
||||
totalCount = totalCount.toInt()
|
||||
)
|
||||
RtcCallIntentConsensus.None -> CallIntentConsensus.None
|
||||
}
|
||||
|
||||
fun RtcCallIntent.map(): CallIntent = when (this) {
|
||||
RtcCallIntent.VIDEO -> CallIntent.VIDEO
|
||||
RtcCallIntent.AUDIO -> CallIntent.AUDIO
|
||||
}
|
||||
@@ -75,6 +75,7 @@ class RoomInfoMapper {
|
||||
roomVersion = it.roomVersion,
|
||||
privilegedCreatorRole = it.privilegedCreatorsRole,
|
||||
isLowPriority = it.isLowPriority,
|
||||
activeCallIntentConsensus = it.activeRoomCallConsensusIntent.map(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.matrix.rustcomponents.sdk.RoomInfo
|
||||
import org.matrix.rustcomponents.sdk.RoomMember
|
||||
import org.matrix.rustcomponents.sdk.RoomNotificationMode
|
||||
import org.matrix.rustcomponents.sdk.RoomPowerLevels
|
||||
import org.matrix.rustcomponents.sdk.RtcCallIntentConsensus
|
||||
import org.matrix.rustcomponents.sdk.SuccessorRoom
|
||||
import uniffi.matrix_sdk_base.EncryptionState
|
||||
|
||||
@@ -60,6 +61,7 @@ internal fun aRustRoomInfo(
|
||||
privilegedCreatorsRole: Boolean = false,
|
||||
serviceMembers: List<String> = emptyList(),
|
||||
isLowPriority: Boolean = false,
|
||||
activeRoomCallConsensusIntent: RtcCallIntentConsensus = RtcCallIntentConsensus.None,
|
||||
) = RoomInfo(
|
||||
id = id,
|
||||
displayName = displayName,
|
||||
@@ -98,4 +100,5 @@ internal fun aRustRoomInfo(
|
||||
privilegedCreatorsRole = privilegedCreatorsRole,
|
||||
serviceMembers = serviceMembers,
|
||||
isLowPriority = isLowPriority,
|
||||
activeRoomCallConsensusIntent = activeRoomCallConsensusIntent,
|
||||
)
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
package io.element.android.libraries.matrix.impl.room
|
||||
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.libraries.matrix.api.notification.CallIntent
|
||||
import io.element.android.libraries.matrix.api.room.CallIntentConsensus
|
||||
import io.element.android.libraries.matrix.api.room.CurrentUserMembership
|
||||
import io.element.android.libraries.matrix.api.room.RoomInfo
|
||||
import io.element.android.libraries.matrix.api.room.RoomNotificationMode
|
||||
@@ -34,6 +36,8 @@ import kotlinx.collections.immutable.persistentMapOf
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import org.junit.Test
|
||||
import org.matrix.rustcomponents.sdk.Membership
|
||||
import org.matrix.rustcomponents.sdk.RtcCallIntent
|
||||
import org.matrix.rustcomponents.sdk.RtcCallIntentConsensus
|
||||
import uniffi.matrix_sdk_base.EncryptionState
|
||||
import org.matrix.rustcomponents.sdk.JoinRule as RustJoinRule
|
||||
import org.matrix.rustcomponents.sdk.RoomHistoryVisibility as RustRoomHistoryVisibility
|
||||
@@ -81,6 +85,7 @@ class RoomInfoMapperTest {
|
||||
roomVersion = "12",
|
||||
privilegedCreatorsRole = true,
|
||||
isLowPriority = true,
|
||||
activeRoomCallConsensusIntent = RtcCallIntentConsensus.Full(RtcCallIntent.AUDIO),
|
||||
)
|
||||
)
|
||||
).isEqualTo(
|
||||
@@ -130,6 +135,7 @@ class RoomInfoMapperTest {
|
||||
roomVersion = "12",
|
||||
privilegedCreatorRole = true,
|
||||
isLowPriority = true,
|
||||
activeCallIntentConsensus = CallIntentConsensus.Full(CallIntent.AUDIO),
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -174,6 +180,7 @@ class RoomInfoMapperTest {
|
||||
roomVersion = "12",
|
||||
privilegedCreatorsRole = true,
|
||||
isLowPriority = true,
|
||||
activeRoomCallConsensusIntent = RtcCallIntentConsensus.None,
|
||||
)
|
||||
)
|
||||
).isEqualTo(
|
||||
@@ -217,6 +224,7 @@ class RoomInfoMapperTest {
|
||||
roomVersion = "12",
|
||||
privilegedCreatorRole = true,
|
||||
isLowPriority = true,
|
||||
activeCallIntentConsensus = CallIntentConsensus.None,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.core.RoomAlias
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
import io.element.android.libraries.matrix.api.room.CallIntentConsensus
|
||||
import io.element.android.libraries.matrix.api.room.CurrentUserMembership
|
||||
import io.element.android.libraries.matrix.api.room.RoomInfo
|
||||
import io.element.android.libraries.matrix.api.room.RoomMember
|
||||
@@ -69,6 +70,7 @@ fun aRoomInfo(
|
||||
roomVersion: String? = "11",
|
||||
privilegedCreatorRole: Boolean = false,
|
||||
isLowPriority: Boolean = false,
|
||||
activeCallIntentConsensus: CallIntentConsensus = CallIntentConsensus.None,
|
||||
) = RoomInfo(
|
||||
id = id,
|
||||
name = name,
|
||||
@@ -106,4 +108,5 @@ fun aRoomInfo(
|
||||
roomVersion = roomVersion,
|
||||
privilegedCreatorRole = privilegedCreatorRole,
|
||||
isLowPriority = isLowPriority,
|
||||
activeCallIntentConsensus = activeCallIntentConsensus,
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.core.RoomAlias
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
import io.element.android.libraries.matrix.api.room.CallIntentConsensus
|
||||
import io.element.android.libraries.matrix.api.room.CurrentUserMembership
|
||||
import io.element.android.libraries.matrix.api.room.RoomInfo
|
||||
import io.element.android.libraries.matrix.api.room.RoomMember
|
||||
@@ -79,6 +80,7 @@ fun aRoomSummary(
|
||||
roomVersion: String? = "11",
|
||||
privilegedCreatorRole: Boolean = false,
|
||||
isLowPriority: Boolean = false,
|
||||
activeCallIntentConsensus: CallIntentConsensus = CallIntentConsensus.None,
|
||||
) = RoomSummary(
|
||||
info = RoomInfo(
|
||||
id = roomId,
|
||||
@@ -117,6 +119,7 @@ fun aRoomSummary(
|
||||
roomVersion = roomVersion,
|
||||
privilegedCreatorRole = privilegedCreatorRole,
|
||||
isLowPriority = isLowPriority,
|
||||
activeCallIntentConsensus = activeCallIntentConsensus,
|
||||
),
|
||||
latestEvent = latestEvent,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user