mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Show user statuses in the DM room header.
This commit is contained in:
@@ -42,7 +42,7 @@ enum RoomScreenViewAction {
|
||||
struct RoomScreenViewState: BindableState {
|
||||
var roomTitle = ""
|
||||
var roomAvatar: RoomAvatar
|
||||
var dmRecipientVerificationState: UserIdentityVerificationState?
|
||||
var dmRecipientDetails = RoomHeaderView.DMRecipientDetails()
|
||||
|
||||
var lastScrollDirection: ScrollDirection?
|
||||
// This is used to control the banner
|
||||
|
||||
@@ -274,17 +274,17 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
guard roomProxy.infoPublisher.value.isDM,
|
||||
let dmRecipient = roomProxy.membersPublisher.value.first(where: { $0.userID != roomProxy.ownUserID }),
|
||||
case let .success(userIdentity) = await clientProxy.userIdentity(for: dmRecipient.userID, fallBackToServer: true) else {
|
||||
state.dmRecipientVerificationState = .notVerified
|
||||
state.dmRecipientDetails.verification = .notVerified
|
||||
return
|
||||
}
|
||||
|
||||
guard let userIdentity else {
|
||||
MXLog.failure("User identity should be known at this point")
|
||||
state.dmRecipientVerificationState = .notVerified
|
||||
state.dmRecipientDetails.verification = .notVerified
|
||||
return
|
||||
}
|
||||
|
||||
state.dmRecipientVerificationState = userIdentity.verificationState
|
||||
state.dmRecipientDetails.verification = userIdentity.verificationState
|
||||
}
|
||||
|
||||
private func resolveIdentityPinningViolation(_ userID: String) async {
|
||||
|
||||
@@ -292,7 +292,7 @@ struct RoomScreen: View {
|
||||
ToolbarItem(placement: .principal) {
|
||||
RoomHeaderView(roomName: context.viewState.roomTitle,
|
||||
roomAvatar: context.viewState.roomAvatar,
|
||||
dmRecipientVerificationState: context.viewState.dmRecipientVerificationState,
|
||||
dmRecipientDetails: context.viewState.dmRecipientDetails,
|
||||
roomHistorySharingState: context.viewState.roomHistorySharingState,
|
||||
mediaProvider: context.mediaProvider) {
|
||||
context.send(viewAction: .displayRoomDetails)
|
||||
|
||||
Reference in New Issue
Block a user