* update the sdk, and updated the power levels APIs Revert "update the sdk, and updated the power levels APIs" This reverts commit d3b291003d2b6fd6346ef7e445af4970fda62348. x * pr suggestions
70 lines
2.0 KiB
Swift
70 lines
2.0 KiB
Swift
//
|
|
// Copyright 2024 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 Combine
|
|
import Foundation
|
|
import MatrixRustSDK
|
|
|
|
@MainActor
|
|
struct KnockedRoomProxyMockConfiguration {
|
|
var id = UUID().uuidString
|
|
var name: String?
|
|
var avatarURL: URL?
|
|
var members: [RoomMemberProxyMock] = .allMembers
|
|
}
|
|
|
|
extension KnockedRoomProxyMock {
|
|
@MainActor
|
|
convenience init(_ configuration: KnockedRoomProxyMockConfiguration) {
|
|
self.init()
|
|
id = configuration.id
|
|
info = RoomInfoProxyMock(configuration)
|
|
}
|
|
}
|
|
|
|
extension RoomInfoProxyMock {
|
|
@MainActor convenience init(_ configuration: KnockedRoomProxyMockConfiguration) {
|
|
self.init()
|
|
|
|
id = configuration.id
|
|
isEncrypted = false
|
|
creators = []
|
|
displayName = configuration.name
|
|
rawName = nil
|
|
topic = nil
|
|
|
|
avatarURL = configuration.avatarURL
|
|
|
|
isDirect = false
|
|
isSpace = false
|
|
successor = nil
|
|
isFavourite = false
|
|
canonicalAlias = nil
|
|
alternativeAliases = []
|
|
membership = .knocked
|
|
inviter = nil
|
|
heroes = []
|
|
activeMembersCount = configuration.members.filter { $0.membership == .join || $0.membership == .invite }.count
|
|
invitedMembersCount = configuration.members.filter { $0.membership == .invite }.count
|
|
joinedMembersCount = configuration.members.filter { $0.membership == .join }.count
|
|
highlightCount = 0
|
|
notificationCount = 0
|
|
cachedUserDefinedNotificationMode = nil
|
|
hasRoomCall = false
|
|
activeRoomCallParticipants = []
|
|
isMarkedUnread = false
|
|
unreadMessagesCount = 0
|
|
unreadNotificationsCount = 0
|
|
unreadMentionsCount = 0
|
|
pinnedEventIDs = []
|
|
joinRule = .knock
|
|
historyVisibility = .shared
|
|
|
|
powerLevels = RoomPowerLevelsProxyMock(configuration: .init())
|
|
}
|
|
}
|