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 f8cd8b3cc2
commit b7831f44cc
6 changed files with 50 additions and 8 deletions
@@ -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,
@@ -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 {