use isDM from the SDK to determine if a spaceRoom, a joinedRoom or a notificationItem are from a dm room.

This commit is contained in:
Mauro Romito
2026-05-13 17:43:58 +02:00
committed by Mauro
parent ff5dcb040d
commit a4a857003c
29 changed files with 81 additions and 45 deletions
@@ -49,6 +49,10 @@ struct RoomInfoProxy: RoomInfoProxyProtocol {
var isDirect: Bool {
roomInfo.isDirect
}
var isDM: Bool {
roomInfo.isDm
}
var isSpace: Bool {
roomInfo.isSpace
@@ -36,6 +36,7 @@ protocol RoomInfoProxyProtocol: BaseRoomInfoProxyProtocol {
var isEncrypted: Bool { get }
var isDirect: Bool { get }
var isDM: Bool { get }
var isSpace: Bool { get }
var isFavourite: Bool { get }
@@ -51,4 +51,8 @@ final class RoomMemberProxy: RoomMemberProxyProtocol {
var powerLevel: RoomPowerLevel {
.init(rustPowerLevel: member.powerLevel)
}
var isServiceMember: Bool {
member.isServiceMember
}
}
@@ -25,6 +25,8 @@ protocol RoomMemberProxyProtocol: AnyObject {
var isIgnored: Bool { get }
var powerLevel: RoomPowerLevel { get }
var isServiceMember: Bool { get }
}
extension RoomMemberProxyProtocol {
@@ -222,10 +222,6 @@ extension JoinedRoomProxyProtocol {
isDirect: infoPublisher.value.isDirect,
historySharingState: historySharingState)
}
var isDirectOneToOneRoom: Bool {
infoPublisher.value.isDirect && infoPublisher.value.activeMembersCount <= 2
}
func members() async -> [RoomMemberProxyProtocol]? {
await updateMembers()