Update SDK version to 25.03.13 and fix breaking changes (#4406)
Breaking changes addressed: * Make `MatrixClient.getNotificationSettings()` async, cache its result. * Use `RoomInfo` for accessing the updated room's info. * Refactor `MatrixRoom` so it always receives an initial `MatrixRoomInfo` value: this value will be used to make `MatrixRoom.roomInfoFlow` a `StateFlow` so we can assume the initial updated Room data will be present. * Fetch encryption state when loading a room if it's unknown
This commit is contained in:
parent
0c07a8165f
commit
fccd881b1f
76 changed files with 647 additions and 431 deletions
|
|
@ -26,12 +26,12 @@ class RoomCallStatePresenter @Inject constructor(
|
|||
) : Presenter<RoomCallState> {
|
||||
@Composable
|
||||
override fun present(): RoomCallState {
|
||||
val roomInfo by room.roomInfoFlow.collectAsState(null)
|
||||
val roomInfo by room.roomInfoFlow.collectAsState()
|
||||
val syncUpdateFlow = room.syncUpdateFlow.collectAsState()
|
||||
val canJoinCall by room.canCall(updateKey = syncUpdateFlow.value)
|
||||
val isUserInTheCall by remember {
|
||||
derivedStateOf {
|
||||
room.sessionId in roomInfo?.activeRoomCallParticipants.orEmpty()
|
||||
room.sessionId in roomInfo.activeRoomCallParticipants
|
||||
}
|
||||
}
|
||||
val currentCall by currentCallService.currentCall.collectAsState()
|
||||
|
|
@ -41,7 +41,7 @@ class RoomCallStatePresenter @Inject constructor(
|
|||
}
|
||||
}
|
||||
val callState = when {
|
||||
roomInfo?.hasRoomCall == true -> RoomCallState.OnGoing(
|
||||
roomInfo.hasRoomCall -> RoomCallState.OnGoing(
|
||||
canJoinCall = canJoinCall,
|
||||
isUserInTheCall = isUserInTheCall,
|
||||
isUserLocallyInTheCall = isUserLocallyInTheCall,
|
||||
|
|
|
|||
|
|
@ -58,12 +58,10 @@ class RoomCallStatePresenterTest {
|
|||
fun `present - call is disabled if user cannot join it even if there is an ongoing call`() = runTest {
|
||||
val room = FakeMatrixRoom(
|
||||
canUserJoinCallResult = { Result.success(false) },
|
||||
).apply {
|
||||
givenRoomInfo(aRoomInfo(hasRoomCall = true))
|
||||
}
|
||||
initialRoomInfo = aRoomInfo(hasRoomCall = true),
|
||||
)
|
||||
val presenter = createRoomCallStatePresenter(matrixRoom = room)
|
||||
presenter.test {
|
||||
skipItems(1)
|
||||
assertThat(awaitItem()).isEqualTo(
|
||||
RoomCallState.OnGoing(
|
||||
canJoinCall = false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue