diff --git a/CHANGES.md b/CHANGES.md index b76b001268..50db24d623 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Bugfix 🐛: - Fix a problem with database migration on nightly builds (#3335) - Implement a workaround to render <del> and <u> in the timeline (#1817) - Make sure the SDK can retrieve the secret storage if the system is upgraded (#3304) + - Spaces | Explore room list: the RoomId is displayed instead of name (#3371) - Spaces | Personal spaces add DM - Web Parity (#3271) - Spaces | Improve 'Leave Space' UX/UI (#3359) - Don't create private spaces with encryption enabled (#3363) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/SpaceChildInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/SpaceChildInfo.kt index 2d31930b33..66293bcb8c 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/SpaceChildInfo.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/SpaceChildInfo.kt @@ -30,5 +30,7 @@ data class SpaceChildInfo( val autoJoin: Boolean, val viaServers: List, val parentRoomId: String?, - val suggested: Boolean? + val suggested: Boolean?, + val canonicalAlias: String?, + val aliases: List? ) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt index 3bf3f66e40..deb279eb95 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt @@ -159,4 +159,4 @@ fun RoomMemberSummary.toMatrixItem() = MatrixItem.UserItem(userId, displayName, fun SenderInfo.toMatrixItem() = MatrixItem.UserItem(userId, disambiguatedDisplayName, avatarUrl) -fun SpaceChildInfo.toMatrixItem() = MatrixItem.RoomItem(childRoomId, name, avatarUrl) +fun SpaceChildInfo.toMatrixItem() = MatrixItem.RoomItem(childRoomId, name ?: canonicalAlias ?: "", avatarUrl) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/RoomSummaryMapper.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/RoomSummaryMapper.kt index fbecbf37be..3fea15bd3d 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/RoomSummaryMapper.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/RoomSummaryMapper.kt @@ -90,7 +90,9 @@ internal class RoomSummaryMapper @Inject constructor(private val timelineEventMa autoJoin = it.autoJoin ?: false, viaServers = it.viaServers.toList(), parentRoomId = roomSummaryEntity.roomId, - suggested = it.suggested + suggested = it.suggested, + canonicalAlias = it.childSummaryEntity?.canonicalAlias, + aliases = it.childSummaryEntity?.aliases?.toList() ) }, flattenParentIds = roomSummaryEntity.flattenParentIds?.split("|") ?: emptyList() diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt index 4c29692213..d0ad19245f 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/DefaultSpaceService.kt @@ -145,7 +145,9 @@ internal class DefaultSpaceService @Inject constructor( viaServers = childStateEvContent.via.orEmpty(), activeMemberCount = childSummary.numJoinedMembers, parentRoomId = childStateEv.roomId, - suggested = childStateEvContent.suggested + suggested = childStateEvContent.suggested, + canonicalAlias = childSummary.canonicalAlias, + aliases = childSummary.aliases ) } }.orEmpty() diff --git a/vector/src/main/java/im/vector/app/features/spaces/explore/SpaceDirectoryController.kt b/vector/src/main/java/im/vector/app/features/spaces/explore/SpaceDirectoryController.kt index c7ec61aaa1..e334868d7c 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/explore/SpaceDirectoryController.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/explore/SpaceDirectoryController.kt @@ -36,7 +36,7 @@ import org.matrix.android.sdk.api.failure.Failure import org.matrix.android.sdk.api.failure.MatrixError.Companion.M_UNRECOGNIZED import org.matrix.android.sdk.api.session.room.model.RoomType import org.matrix.android.sdk.api.session.room.model.SpaceChildInfo -import org.matrix.android.sdk.api.util.MatrixItem +import org.matrix.android.sdk.api.util.toMatrixItem import javax.inject.Inject class SpaceDirectoryController @Inject constructor( @@ -124,7 +124,7 @@ class SpaceDirectoryController @Inject constructor( val isLoading = data?.changeMembershipStates?.get(info.childRoomId)?.isInProgress() ?: false spaceChildInfoItem { id(info.childRoomId) - matrixItem(MatrixItem.RoomItem(info.childRoomId, info.name, info.avatarUrl)) + matrixItem(info.toMatrixItem()) avatarRenderer(host.avatarRenderer) topic(info.topic) memberCount(info.activeMemberCount ?: 0)