handle the case where a non parent joined space is already available in the existing restricted join rule

This commit is contained in:
Mauro Romito
2025-12-11 16:53:13 +01:00
committed by Mauro
parent 00b2895e25
commit 55e88245f5
13 changed files with 266 additions and 42 deletions
@@ -40,6 +40,15 @@ class SpaceServiceProxy: SpaceServiceProxyProtocol {
}
}
func spaceForIdentifier(spaceID: String) async -> Result<SpaceRoomProxyProtocol?, SpaceServiceProxyError> {
do {
return try await .success(spaceService.getSpaceRoom(roomId: spaceID).map(SpaceRoomProxy.init))
} catch {
MXLog.error("Failed getting space room for \(spaceID): \(error)")
return .failure(.sdkError(error))
}
}
func leaveSpace(spaceID: String) async -> Result<LeaveSpaceHandleProxy, SpaceServiceProxyError> {
do {
return try await .success(.init(spaceID: spaceID, leaveHandle: spaceService.leaveSpace(spaceId: spaceID)))