Remove JoinRule.Private from the codebase (#6129)
It shouldn't be in use, since it was never properly defined: - The `Private` values coming from the SDK are considered to be `Invite` instead. - Remove any existing `JoinRule.Private` usages in our code.
This commit is contained in:
parent
4776dcc1e9
commit
bd6bad963e
12 changed files with 14 additions and 46 deletions
|
|
@ -376,10 +376,9 @@ private fun JoinRule?.toJoinAuthorisationStatus(): JoinAuthorisationStatus {
|
|||
return when (this) {
|
||||
JoinRule.Knock,
|
||||
is JoinRule.KnockRestricted -> JoinAuthorisationStatus.CanKnock
|
||||
JoinRule.Invite,
|
||||
JoinRule.Private -> JoinAuthorisationStatus.NeedInvite
|
||||
JoinRule.Invite -> JoinAuthorisationStatus.NeedInvite
|
||||
is JoinRule.Restricted -> JoinAuthorisationStatus.Restricted
|
||||
JoinRule.Public -> JoinAuthorisationStatus.CanJoin
|
||||
else -> JoinAuthorisationStatus.Unknown
|
||||
is JoinRule.Custom, null -> JoinAuthorisationStatus.Unknown
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1035,34 +1035,6 @@ class JoinRoomPresenterTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `present - when room is not known RoomPreview is loaded as Private`() = runTest {
|
||||
val client = FakeMatrixClient(
|
||||
getNotJoinedRoomResult = { _, _ ->
|
||||
Result.success(
|
||||
aRoomPreview(
|
||||
info = aRoomPreviewInfo(joinRule = JoinRule.Private),
|
||||
roomMembershipDetails = {
|
||||
Result.success(aRoomMembershipDetails())
|
||||
},
|
||||
)
|
||||
)
|
||||
},
|
||||
spaceService = FakeSpaceService(
|
||||
spaceRoomListResult = { FakeSpaceRoomList() },
|
||||
),
|
||||
)
|
||||
val presenter = createJoinRoomPresenter(
|
||||
matrixClient = client
|
||||
)
|
||||
presenter.test {
|
||||
skipItems(1)
|
||||
awaitItem().also { state ->
|
||||
assertThat(state.joinAuthorisationStatus).isEqualTo(JoinAuthorisationStatus.NeedInvite)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `present - when room is not known RoomPreview is loaded as Custom`() = runTest {
|
||||
val client = FakeMatrixClient(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue