feat(security&privacy) : expose methods from sdk to update alias and rename alias to canonicalAlias

This commit is contained in:
ganfra 2025-01-22 15:12:38 +01:00
parent e56fe4fb38
commit 70f39c4f7c
6 changed files with 50 additions and 8 deletions

View file

@ -150,7 +150,7 @@ class RoomDetailsPresenter @Inject constructor(
return RoomDetailsState(
roomId = room.roomId,
roomName = roomName,
roomAlias = room.alias,
roomAlias = room.canonicalAlias,
roomAvatarUrl = roomAvatar,
roomTopic = topicState,
memberCount = room.joinedMemberCount,

View file

@ -72,10 +72,10 @@ class EditRoomAddressPresenter @Inject constructor(
private fun MatrixRoom.firstAliasMatching(serverName: String): RoomAlias? {
// Check if the canonical alias matches the homeserver
if (this.alias?.matchesServer(serverName) == true) {
return this.alias
if (canonicalAlias?.matchesServer(serverName) == true) {
return canonicalAlias
}
return this.alternativeAliases.firstOrNull { it.value.contains(serverName) }
return alternativeAliases.firstOrNull { it.value.contains(serverName) }
}
private fun RoomAlias.roomAddress(): String {