mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:06:00 +00:00
Fixes #3078 - Trim number of resolved alias vias and always default to a join button in the room preview screen
This commit is contained in:
committed by
Stefan Ceriu
parent
37786b8fad
commit
f44c0765f8
@@ -608,7 +608,14 @@ class ClientProxy: ClientProxyProtocol {
|
||||
|
||||
func resolveRoomAlias(_ alias: String) async -> Result<ResolvedRoomAlias, ClientProxyError> {
|
||||
do {
|
||||
return try await .success(client.resolveRoomAlias(roomAlias: alias))
|
||||
let resolvedAlias = try await client.resolveRoomAlias(roomAlias: alias)
|
||||
|
||||
// Resolving aliases is done through the directory/room API which returns too many / all known
|
||||
// vias, which in turn results in invalid join requests. Trim them to something manageable
|
||||
// https://github.com/element-hq/synapse/issues/17298
|
||||
let limitedAlias = ResolvedRoomAlias(roomId: resolvedAlias.roomId, servers: Array(resolvedAlias.servers.prefix(50)))
|
||||
|
||||
return .success(limitedAlias)
|
||||
} catch {
|
||||
MXLog.error("Failed resolving room alias: \(alias) with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
|
||||
Reference in New Issue
Block a user