Add support for initiating and responding to user verification requests (#3759)

This commit is contained in:
Stefan Ceriu
2025-02-10 20:07:11 +02:00
committed by GitHub
parent 22d0fae423
commit 8680d8437b
94 changed files with 528 additions and 208 deletions
@@ -21,6 +21,7 @@ enum RoomMemberDetailsScreenCoordinatorAction {
case openUserProfile
case openDirectChat(roomID: String)
case startCall(roomID: String)
case verifyUser(userID: String)
}
final class RoomMemberDetailsScreenCoordinator: CoordinatorProtocol {
@@ -53,6 +54,8 @@ final class RoomMemberDetailsScreenCoordinator: CoordinatorProtocol {
actionsSubject.send(.openDirectChat(roomID: roomID))
case .startCall(let roomID):
actionsSubject.send(.startCall(roomID: roomID))
case .verifyUser(let userID):
actionsSubject.send(.verifyUser(userID: userID))
}
}
.store(in: &cancellables)
@@ -11,6 +11,7 @@ enum RoomMemberDetailsScreenViewModelAction {
case openUserProfile
case openDirectChat(roomID: String)
case startCall(roomID: String)
case verifyUser(userID: String)
}
struct RoomMemberDetailsScreenViewState: BindableState {
@@ -88,6 +89,7 @@ enum RoomMemberDetailsScreenViewAction {
case openDirectChat
case createDirectChat
case startCall(roomID: String)
case verifyUser
}
enum RoomMemberDetailsScreenAlertType: Hashable {
@@ -75,6 +75,8 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro
Task { await createDirectChat() }
case .startCall(let roomID):
actionsSubject.send(.startCall(roomID: roomID))
case .verifyUser:
actionsSubject.send(.verifyUser(userID: state.userID))
}
}
@@ -91,11 +91,10 @@ struct RoomMemberDetailsScreen: View {
var verificationSection: some View {
if context.viewState.showVerificationSection {
Section {
ListRow(label: .default(title: L10n.commonVerifyIdentity,
description: L10n.screenRoomMemberDetailsVerifyButtonSubtitle,
icon: \.lock),
kind: .button { })
.disabled(true)
ListRow(label: .default(title: L10n.commonVerifyUser, icon: \.lock),
kind: .button {
context.send(viewAction: .verifyUser)
})
}
}
}