Rename SpaceRoomProxy to SpaceServiceRoom and stop proxying the struct. (#4952)

* Rename SpaceRoomProxy to SpaceServiceRoom.

The underlying type is a struct, we don't need to proxy it.

* Actually stop proxying the SpaceRoom.
This commit is contained in:
Doug
2026-01-13 12:00:20 +00:00
committed by GitHub
parent de1753a766
commit 334df3f5cd
43 changed files with 620 additions and 604 deletions
@@ -0,0 +1,54 @@
//
// Copyright 2025 Element Creations Ltd.
// Copyright 2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import Foundation
import MatrixRustSDK
struct SpaceServiceRoom: SpaceServiceRoomProtocol {
var id: String
var name: String
var rawName: String?
var avatarURL: URL?
var isSpace: Bool
var isDirect: Bool?
var childrenCount: Int
var joinedMembersCount: Int
var heroes: [UserProfileProxy]
var topic: String?
var canonicalAlias: String?
var joinRule: JoinRule?
var worldReadable: Bool?
var guestCanJoin: Bool
var state: Membership?
var via: [String]
init(spaceRoom: SpaceRoom) {
id = spaceRoom.roomId
name = spaceRoom.displayName
rawName = spaceRoom.rawName
avatarURL = spaceRoom.avatarUrl.flatMap(URL.init)
isSpace = spaceRoom.roomType == .space
isDirect = spaceRoom.isDirect
childrenCount = Int(spaceRoom.childrenCount)
joinedMembersCount = Int(spaceRoom.numJoinedMembers)
heroes = (spaceRoom.heroes ?? []).map(UserProfileProxy.init)
topic = spaceRoom.topic
canonicalAlias = spaceRoom.canonicalAlias
joinRule = spaceRoom.joinRule
worldReadable = spaceRoom.worldReadable
guestCanJoin = spaceRoom.guestCanJoin
state = spaceRoom.state
via = spaceRoom.via
}
}