Add a workaround to include some via parameters for room v12 tombstone links. (#4413)

Without them, following the link fails as previously the server could use the server name from the room ID (which in and of itself seems somewhat error prone).
This commit is contained in:
Doug
2025-08-14 13:02:07 +01:00
committed by GitHub
parent 3dc6d73899
commit de626186bd
7 changed files with 23 additions and 11 deletions
@@ -200,4 +200,13 @@ extension JoinedRoomProxyProtocol {
await updateMembers()
return membersPublisher.value
}
// This is a horrible workaround for not having any server names available when using tombstone links with v12 room IDs.
func knownServerNames(maxCount: Int) -> any Sequence<String> {
membersPublisher.value
.prefix(1000) // No need to go crazy here…
.compactMap { $0.userID.split(separator: ":").last.map(String.init) }
.uniqued()
.prefix(maxCount)
}
}