Make MatrixClient return a RoomPreview instance, not a RoomPreviewInfo one.

This commit is contained in:
Jorge Martín 2025-02-10 16:17:24 +01:00 committed by Jorge Martin Espinosa
parent e8dd8a1a87
commit fa5ee41867
11 changed files with 101 additions and 58 deletions

View file

@ -104,10 +104,12 @@ class JoinRoomPresenter @AssistedInject constructor(
}
else -> {
value = ContentState.Loading
val result = matrixClient.getRoomPreviewInfo(roomIdOrAlias, serverNames)
val result = matrixClient.getRoomPreview(roomIdOrAlias, serverNames)
value = result.fold(
onSuccess = { previewInfo ->
previewInfo.toContentState()
onSuccess = { preview ->
preview.info.toContentState()
},
onFailure = { throwable ->
if (throwable is ClientException.MatrixApi && (throwable.kind == ErrorKind.NotFound || throwable.kind == ErrorKind.Forbidden)) {