Promote "history sharing on invite" out of developer options (#6647)
* Enable history sharing by default, unconditionally * Remove feature-flag dep from history viz icons in room header * Remove feature-flag dep from warning on inviting new people * Remove feature-flag dep from warning on starting chat with new people * Remove `enableKeyShareOnInvite` feature flag * Update screenshots * Remove redundant `FakeFeatureFlagService()` invocation, per review comment --------- Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
parent
b17388d686
commit
e961214c4d
63 changed files with 106 additions and 206 deletions
|
|
@ -168,8 +168,6 @@ class RoomDetailsPresenter(
|
|||
|
||||
val canReportRoom by produceState(false) { value = client.canReportRoom() }
|
||||
|
||||
val enableKeyShareOnInvite by featureFlagService.isFeatureEnabledFlow(FeatureFlags.EnableKeyShareOnInvite).collectAsState(initial = false)
|
||||
|
||||
return RoomDetailsState(
|
||||
roomId = room.roomId,
|
||||
roomName = roomName,
|
||||
|
|
@ -199,7 +197,6 @@ class RoomDetailsPresenter(
|
|||
isTombstoned = roomInfo.successorRoom != null,
|
||||
showDebugInfo = isDeveloperModeEnabled,
|
||||
roomVersion = roomInfo.roomVersion,
|
||||
enableKeyShareOnInvite = enableKeyShareOnInvite,
|
||||
roomHistoryVisibility = roomInfo.historyVisibility,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ data class RoomDetailsState(
|
|||
val isTombstoned: Boolean,
|
||||
val showDebugInfo: Boolean,
|
||||
val roomVersion: String?,
|
||||
val enableKeyShareOnInvite: Boolean,
|
||||
val roomHistoryVisibility: RoomHistoryVisibility,
|
||||
val eventSink: (RoomDetailsEvent) -> Unit
|
||||
) {
|
||||
|
|
@ -64,7 +63,7 @@ data class RoomDetailsState(
|
|||
if (isPublic) {
|
||||
add(RoomBadge.PUBLIC)
|
||||
}
|
||||
if (enableKeyShareOnInvite && isEncrypted) {
|
||||
if (isEncrypted) {
|
||||
when (roomHistoryVisibility) {
|
||||
RoomHistoryVisibility.Invited, RoomHistoryVisibility.Joined -> add(RoomBadge.SHARED_HISTORY_HIDDEN)
|
||||
RoomHistoryVisibility.Shared -> add(RoomBadge.SHARED_HISTORY_SHARED)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ fun aRoomDetailsState(
|
|||
canReportRoom: Boolean = true,
|
||||
isTombstoned: Boolean = false,
|
||||
showDebugInfo: Boolean = false,
|
||||
enableKeyShareOnInvite: Boolean = false,
|
||||
roomHistoryVisibility: RoomHistoryVisibility = RoomHistoryVisibility.Shared,
|
||||
eventSink: (RoomDetailsEvent) -> Unit = {},
|
||||
) = RoomDetailsState(
|
||||
|
|
@ -153,7 +152,6 @@ fun aRoomDetailsState(
|
|||
isTombstoned = isTombstoned,
|
||||
showDebugInfo = showDebugInfo,
|
||||
roomVersion = "12",
|
||||
enableKeyShareOnInvite = enableKeyShareOnInvite,
|
||||
roomHistoryVisibility = roomHistoryVisibility,
|
||||
eventSink = eventSink,
|
||||
)
|
||||
|
|
@ -195,6 +193,5 @@ fun aSharedHistoryRoomDetailsState(
|
|||
roomHistoryVisibility: RoomHistoryVisibility
|
||||
) = aRoomDetailsState(
|
||||
isEncrypted = true,
|
||||
enableKeyShareOnInvite = true,
|
||||
roomHistoryVisibility = roomHistoryVisibility,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -37,24 +37,24 @@ class RoomDetailsStateTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
fun `room public encrypted should have encrypted and public badges`() {
|
||||
fun `room public encrypted should have encrypted, public, and history sharing shared badges`() {
|
||||
val sut = aRoomDetailsState(
|
||||
isPublic = true,
|
||||
isEncrypted = true,
|
||||
)
|
||||
assertThat(sut.roomBadges).isEqualTo(
|
||||
persistentListOf(RoomBadge.ENCRYPTED, RoomBadge.PUBLIC)
|
||||
persistentListOf(RoomBadge.ENCRYPTED, RoomBadge.PUBLIC, RoomBadge.SHARED_HISTORY_SHARED)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `room not public encrypted should have encrypted badges`() {
|
||||
fun `room not public encrypted should have encrypted and history sharing shared badges`() {
|
||||
val sut = aRoomDetailsState(
|
||||
isPublic = false,
|
||||
isEncrypted = true,
|
||||
)
|
||||
assertThat(sut.roomBadges).isEqualTo(
|
||||
persistentListOf(RoomBadge.ENCRYPTED)
|
||||
persistentListOf(RoomBadge.ENCRYPTED, RoomBadge.SHARED_HISTORY_SHARED)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,6 @@ class RoomDetailsStateTest {
|
|||
fun `room public not encrypted should not have history sharing badges`() {
|
||||
val sut = aRoomDetailsState(
|
||||
isEncrypted = false,
|
||||
enableKeyShareOnInvite = true,
|
||||
roomHistoryVisibility = RoomHistoryVisibility.Shared
|
||||
)
|
||||
assertThat(sut.roomBadges).isEqualTo(
|
||||
|
|
@ -74,7 +73,6 @@ class RoomDetailsStateTest {
|
|||
fun `room public encrypted should have history sharing hidden badge`() {
|
||||
val sut = aRoomDetailsState(
|
||||
isEncrypted = true,
|
||||
enableKeyShareOnInvite = true,
|
||||
roomHistoryVisibility = RoomHistoryVisibility.Joined
|
||||
)
|
||||
assertThat(sut.roomBadges).isEqualTo(
|
||||
|
|
@ -83,22 +81,9 @@ class RoomDetailsStateTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
fun `room public encrypted should have history sharing shared badge`() {
|
||||
fun `room public encrypted with world_readable visibility should have history sharing world_readable badge`() {
|
||||
val sut = aRoomDetailsState(
|
||||
isEncrypted = true,
|
||||
enableKeyShareOnInvite = true,
|
||||
roomHistoryVisibility = RoomHistoryVisibility.Shared
|
||||
)
|
||||
assertThat(sut.roomBadges).isEqualTo(
|
||||
persistentListOf(RoomBadge.ENCRYPTED, RoomBadge.PUBLIC, RoomBadge.SHARED_HISTORY_SHARED)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `room public encrypted should have history sharing world_readable badge`() {
|
||||
val sut = aRoomDetailsState(
|
||||
isEncrypted = true,
|
||||
enableKeyShareOnInvite = true,
|
||||
roomHistoryVisibility = RoomHistoryVisibility.WorldReadable
|
||||
)
|
||||
assertThat(sut.roomBadges).isEqualTo(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue