use isDm from the SDK to determine if a room is a direct one to one room.
This commit is contained in:
@@ -15294,6 +15294,11 @@ class RoomInfoProxyMock: RoomInfoProxyProtocol, @unchecked Sendable {
|
||||
set(value) { underlyingIsFavourite = value }
|
||||
}
|
||||
var underlyingIsFavourite: Bool!
|
||||
var isDM: Bool {
|
||||
get { return underlyingIsDM }
|
||||
set(value) { underlyingIsDM = value }
|
||||
}
|
||||
var underlyingIsDM: Bool!
|
||||
var canonicalAlias: String?
|
||||
var alternativeAliases: [String] = []
|
||||
var membership: Membership {
|
||||
|
||||
@@ -182,6 +182,7 @@ extension RoomInfoProxyMock {
|
||||
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
|
||||
isDM = configuration.isDirect && activeMembersCount <= 2
|
||||
highlightCount = 0
|
||||
notificationCount = 0
|
||||
cachedUserDefinedNotificationMode = .allMessages
|
||||
|
||||
@@ -29,6 +29,7 @@ extension ClientBuilder {
|
||||
timeout: requestTimeout,
|
||||
maxConcurrentRequests: nil,
|
||||
maxRetryTime: maxRequestRetryTime))
|
||||
.dmRoomDefinition(dmRoomDefinition: .twoMembers)
|
||||
|
||||
builder = switch slidingSync {
|
||||
case .restored: builder
|
||||
|
||||
@@ -54,6 +54,10 @@ struct RoomInfoProxy: RoomInfoProxyProtocol {
|
||||
roomInfo.isSpace
|
||||
}
|
||||
|
||||
var isDM: Bool {
|
||||
roomInfo.isDm
|
||||
}
|
||||
|
||||
var successor: SuccessorRoom? {
|
||||
roomInfo.successorRoom
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ protocol RoomInfoProxyProtocol: BaseRoomInfoProxyProtocol {
|
||||
var isDirect: Bool { get }
|
||||
var isSpace: Bool { get }
|
||||
var isFavourite: Bool { get }
|
||||
var isDM: Bool { get }
|
||||
|
||||
var canonicalAlias: String? { get }
|
||||
var alternativeAliases: [String] { get }
|
||||
|
||||
@@ -224,7 +224,7 @@ extension JoinedRoomProxyProtocol {
|
||||
}
|
||||
|
||||
var isDirectOneToOneRoom: Bool {
|
||||
infoPublisher.value.isDirect && infoPublisher.value.activeMembersCount <= 2
|
||||
infoPublisher.value.isDM
|
||||
}
|
||||
|
||||
func members() async -> [RoomMemberProxyProtocol]? {
|
||||
|
||||
Reference in New Issue
Block a user