mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user