Skip to content

Commit 22795af

Browse files
authored
Merge pull request #4219 from element-hq/feature/bma/encryptionBadge
Always display encryption badge
2 parents 73c66dd + e214345 commit 22795af

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ data class RoomDetailsState(
4848
val eventSink: (RoomDetailsEvent) -> Unit
4949
) {
5050
val roomBadges = buildList {
51-
if (isEncrypted || isPublic) {
52-
if (isEncrypted) {
53-
add(RoomBadge.ENCRYPTED)
54-
} else {
55-
add(RoomBadge.NOT_ENCRYPTED)
56-
}
51+
if (isEncrypted) {
52+
add(RoomBadge.ENCRYPTED)
53+
} else {
54+
add(RoomBadge.NOT_ENCRYPTED)
5755
}
5856
if (isPublic) {
5957
add(RoomBadge.PUBLIC)

features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ import org.junit.Test
1313

1414
class RoomDetailsStateTest {
1515
@Test
16-
fun `room not public not encrypted should have no badges`() {
16+
fun `room not public not encrypted should have not encrypted badge`() {
1717
val sut = aRoomDetailsState(
1818
isPublic = false,
1919
isEncrypted = false,
2020
)
21-
assertThat(sut.roomBadges).isEmpty()
21+
assertThat(sut.roomBadges).isEqualTo(
22+
persistentListOf(RoomBadge.NOT_ENCRYPTED)
23+
)
2224
}
2325

2426
@Test
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)