mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -172,12 +172,12 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
|
||||
guard state.joinedMembersCount > 1 else {
|
||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomID: roomProxy.id,
|
||||
isDM: roomProxy.isDirectOneToOneRoom,
|
||||
isDM: roomProxy.infoPublisher.value.isDM,
|
||||
state: roomProxy.infoPublisher.value.isPrivate ?? true ? .empty : .public)
|
||||
return
|
||||
}
|
||||
|
||||
if !roomProxy.isDirectOneToOneRoom, state.accountOwner?.role.isOwner == true {
|
||||
if !roomProxy.infoPublisher.value.isDM, state.accountOwner?.role.isOwner == true {
|
||||
var isLastOwner = true
|
||||
for member in roomProxy.membersPublisher.value where member.userID != roomProxy.ownUserID && member.membership == .join {
|
||||
if member.role.isOwner {
|
||||
@@ -199,7 +199,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
}
|
||||
|
||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomID: roomProxy.id,
|
||||
isDM: roomProxy.isDirectOneToOneRoom,
|
||||
isDM: roomProxy.infoPublisher.value.isDM,
|
||||
state: roomProxy.infoPublisher.value.isPrivate ?? true ? .private : .public)
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
self.state.accountOwner = .init(withProxy: accountOwner)
|
||||
}
|
||||
|
||||
guard roomProxy.isDirectOneToOneRoom else {
|
||||
guard roomProxy.infoPublisher.value.isDM else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
return
|
||||
}
|
||||
|
||||
if roomProxy.isDirectOneToOneRoom {
|
||||
if roomProxy.infoPublisher.value.isDM {
|
||||
if var dmRecipientInfo = state.dmRecipientInfo {
|
||||
if case let .success(userIdentity) = await userSession.clientProxy.userIdentity(for: dmRecipientInfo.member.id, fallBackToServer: true) {
|
||||
dmRecipientInfo.verificationState = userIdentity?.verificationState
|
||||
|
||||
Reference in New Issue
Block a user