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:
Jorge Martin Espinosa 2025-03-19 12:52:57 +01:00 committed by GitHub
parent 0c07a8165f
commit fccd881b1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 647 additions and 431 deletions

View file

@ -64,7 +64,7 @@ class MediaGalleryPresenter @AssistedInject constructor(
val coroutineScope = rememberCoroutineScope()
var mode by remember { mutableStateOf(MediaGalleryMode.Images) }
val roomInfo by room.roomInfoFlow.collectAsState(null)
val roomInfo by room.roomInfoFlow.collectAsState()
var mediaBottomSheetState by remember { mutableStateOf<MediaBottomSheetState>(MediaBottomSheetState.Hidden) }
@ -139,7 +139,7 @@ class MediaGalleryPresenter @AssistedInject constructor(
}
return MediaGalleryState(
roomName = roomInfo?.name ?: room.displayName,
roomName = roomInfo.name.orEmpty(),
mode = mode,
groupedMediaItems = groupedMediaItems,
mediaBottomSheetState = mediaBottomSheetState,

View file

@ -20,6 +20,7 @@ import io.element.android.libraries.matrix.test.A_USER_ID
import io.element.android.libraries.matrix.test.A_USER_ID_2
import io.element.android.libraries.matrix.test.media.FakeMatrixMediaLoader
import io.element.android.libraries.matrix.test.room.FakeMatrixRoom
import io.element.android.libraries.matrix.test.room.aRoomInfo
import io.element.android.libraries.matrix.test.timeline.FakeTimeline
import io.element.android.libraries.mediaviewer.impl.datasource.FakeMediaGalleryDataSource
import io.element.android.libraries.mediaviewer.impl.datasource.MediaGalleryDataSource
@ -51,7 +52,7 @@ class MediaGalleryPresenterTest {
startLambda = startLambda,
),
room = FakeMatrixRoom(
displayName = A_ROOM_NAME,
initialRoomInfo = aRoomInfo(name = A_ROOM_NAME),
createTimelineResult = { Result.success(FakeTimeline()) },
)
)
@ -70,7 +71,7 @@ class MediaGalleryPresenterTest {
fun `present - change mode`() = runTest {
val presenter = createMediaGalleryPresenter(
room = FakeMatrixRoom(
displayName = A_ROOM_NAME,
initialRoomInfo = aRoomInfo(name = A_ROOM_NAME),
createTimelineResult = { Result.success(FakeTimeline()) },
)
)
@ -100,7 +101,7 @@ class MediaGalleryPresenterTest {
val presenter = createMediaGalleryPresenter(
room = FakeMatrixRoom(
sessionId = A_USER_ID,
displayName = A_ROOM_NAME,
initialRoomInfo = aRoomInfo(name = A_ROOM_NAME),
createTimelineResult = { Result.success(FakeTimeline()) },
canRedactOwnResult = { Result.success(canDeleteOwn) }
)
@ -143,7 +144,7 @@ class MediaGalleryPresenterTest {
val presenter = createMediaGalleryPresenter(
room = FakeMatrixRoom(
sessionId = A_USER_ID,
displayName = A_ROOM_NAME,
initialRoomInfo = aRoomInfo(name = A_ROOM_NAME),
createTimelineResult = { Result.success(FakeTimeline()) },
canRedactOtherResult = { Result.success(canDeleteOther) }
)
@ -176,7 +177,7 @@ class MediaGalleryPresenterTest {
fun `present - delete bottom sheet`() = runTest {
val presenter = createMediaGalleryPresenter(
room = FakeMatrixRoom(
displayName = A_ROOM_NAME,
initialRoomInfo = aRoomInfo(name = A_ROOM_NAME),
createTimelineResult = { Result.success(FakeTimeline()) },
)
)