mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
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:
committed by
GitHub
parent
0c07a8165f
commit
fccd881b1f
+3
-3
@@ -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,
|
||||
|
||||
+2
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user