deps(sdk): fix api usages
This commit is contained in:
parent
0ef5576c3b
commit
fe65ba1839
11 changed files with 18 additions and 6 deletions
|
|
@ -58,5 +58,7 @@ private fun previewPermissions(): RoomPowerLevelsValues {
|
|||
roomName = RoomMember.Role.Admin.powerLevel,
|
||||
roomAvatar = RoomMember.Role.Moderator.powerLevel,
|
||||
roomTopic = RoomMember.Role.User.powerLevel,
|
||||
// SpaceManagement section
|
||||
spaceChild = RoomMember.Role.Moderator.powerLevel,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class StateContentFormatter(
|
|||
"RoomHistoryVisibility"
|
||||
}
|
||||
}
|
||||
OtherState.RoomJoinRules -> when (renderingMode) {
|
||||
is OtherState.RoomJoinRules -> when (renderingMode) {
|
||||
RenderingMode.RoomList -> {
|
||||
Timber.v("Filtering timeline item for room state change: $content")
|
||||
null
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ data class RoomPowerLevelsValues(
|
|||
val roomName: Long,
|
||||
val roomAvatar: Long,
|
||||
val roomTopic: Long,
|
||||
val spaceChild: Long,
|
||||
)
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
package io.element.android.libraries.matrix.api.timeline.item.event
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import io.element.android.libraries.matrix.api.room.join.JoinRule
|
||||
|
||||
@Immutable
|
||||
sealed interface OtherState {
|
||||
|
|
@ -22,7 +23,7 @@ sealed interface OtherState {
|
|||
data object RoomEncryption : OtherState
|
||||
data object RoomGuestAccess : OtherState
|
||||
data object RoomHistoryVisibility : OtherState
|
||||
data object RoomJoinRules : OtherState
|
||||
data class RoomJoinRules(val joinRule: JoinRule?) : OtherState
|
||||
data class RoomName(val name: String?) : OtherState
|
||||
data class RoomPinnedEvents(val change: Change) : OtherState {
|
||||
enum class Change {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ object RoomPowerLevelsValuesMapper {
|
|||
roomName = values.roomName,
|
||||
roomAvatar = values.roomAvatar,
|
||||
roomTopic = values.roomTopic,
|
||||
spaceChild = values.spaceChild,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import io.element.android.libraries.matrix.api.timeline.item.event.UnknownConten
|
|||
import io.element.android.libraries.matrix.api.timeline.item.event.UtdCause
|
||||
import io.element.android.libraries.matrix.impl.media.map
|
||||
import io.element.android.libraries.matrix.impl.poll.map
|
||||
import io.element.android.libraries.matrix.impl.room.join.map
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableMap
|
||||
import org.matrix.rustcomponents.sdk.EmbeddedEventDetails
|
||||
|
|
@ -210,7 +211,7 @@ private fun RustOtherState.map(): OtherState {
|
|||
RustOtherState.RoomEncryption -> OtherState.RoomEncryption
|
||||
RustOtherState.RoomGuestAccess -> OtherState.RoomGuestAccess
|
||||
RustOtherState.RoomHistoryVisibility -> OtherState.RoomHistoryVisibility
|
||||
RustOtherState.RoomJoinRules -> OtherState.RoomJoinRules
|
||||
is RustOtherState.RoomJoinRules -> OtherState.RoomJoinRules(joinRule?.map())
|
||||
is RustOtherState.RoomName -> OtherState.RoomName(name)
|
||||
is RustOtherState.RoomPinnedEvents -> OtherState.RoomPinnedEvents(change.map())
|
||||
is RustOtherState.RoomPowerLevels -> OtherState.RoomUserPowerLevels(users)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ internal fun aRustRoomPowerLevelsValues(
|
|||
roomName: Long,
|
||||
roomAvatar: Long,
|
||||
roomTopic: Long,
|
||||
spaceChild: Long,
|
||||
) = RoomPowerLevelsValues(
|
||||
ban = ban,
|
||||
invite = invite,
|
||||
|
|
@ -32,4 +33,5 @@ internal fun aRustRoomPowerLevelsValues(
|
|||
roomName = roomName,
|
||||
roomAvatar = roomAvatar,
|
||||
roomTopic = roomTopic,
|
||||
spaceChild = spaceChild
|
||||
)
|
||||
|
|
|
|||
|
|
@ -31,4 +31,5 @@ fun defaultFfiRoomPowerLevelValues() = RoomPowerLevelsValues(
|
|||
roomTopic = 100,
|
||||
stateDefault = 0,
|
||||
usersDefault = 0,
|
||||
spaceChild = 100,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import io.element.android.libraries.matrix.api.room.RoomInfo
|
|||
import io.element.android.libraries.matrix.api.room.RoomMember
|
||||
import io.element.android.libraries.matrix.api.room.RoomMembershipObserver
|
||||
import io.element.android.libraries.matrix.api.room.powerlevels.RoomPowerLevels
|
||||
import io.element.android.libraries.matrix.api.room.powerlevels.RoomPowerLevelsValues
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.MembershipChange
|
||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiRoom
|
||||
import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiRoomListService
|
||||
|
|
@ -24,6 +23,7 @@ import io.element.android.libraries.matrix.test.A_DEVICE_ID
|
|||
import io.element.android.libraries.matrix.test.A_SESSION_ID
|
||||
import io.element.android.libraries.matrix.test.A_USER_ID
|
||||
import io.element.android.libraries.matrix.test.room.aRoomInfo
|
||||
import io.element.android.libraries.matrix.test.room.defaultRoomPowerLevelValues
|
||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||
import kotlinx.collections.immutable.persistentMapOf
|
||||
import kotlinx.coroutines.flow.SharingStarted
|
||||
|
|
@ -128,7 +128,7 @@ class RustBaseRoomTest {
|
|||
val rustBaseRoom = createRustBaseRoom(
|
||||
initialRoomInfo = aRoomInfo(
|
||||
roomPowerLevels = RoomPowerLevels(
|
||||
values = RoomPowerLevelsValues(50, 50, 50, 50, 50, 50, 50, 50),
|
||||
values = defaultRoomPowerLevelValues(),
|
||||
users = persistentMapOf(A_USER_ID to 100L)
|
||||
)
|
||||
),
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class RoomPowerLevelsValuesMapperTest {
|
|||
roomName = 8,
|
||||
roomAvatar = 9,
|
||||
roomTopic = 10,
|
||||
spaceChild = 11,
|
||||
)
|
||||
)
|
||||
).isEqualTo(
|
||||
|
|
@ -41,6 +42,7 @@ class RoomPowerLevelsValuesMapperTest {
|
|||
roomName = 8,
|
||||
roomAvatar = 9,
|
||||
roomTopic = 10,
|
||||
spaceChild = 11,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,5 +260,6 @@ fun defaultRoomPowerLevelValues() = RoomPowerLevelsValues(
|
|||
redactEvents = 50,
|
||||
roomName = 100,
|
||||
roomAvatar = 100,
|
||||
roomTopic = 100
|
||||
roomTopic = 100,
|
||||
spaceChild = 100,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue