Handle external links to a user. (#2690)

This commit is contained in:
Doug
2024-04-15 11:08:00 +01:00
committed by GitHub
parent e0138eeb35
commit e7af7fb59c
22 changed files with 450 additions and 154 deletions
@@ -19,13 +19,16 @@ import SwiftUI
struct UserProfileScreenCoordinatorParameters {
let userID: String
let isPresentedModally: Bool
let clientProxy: ClientProxyProtocol
let mediaProvider: MediaProviderProtocol
let userIndicatorController: UserIndicatorControllerProtocol
let analytics: AnalyticsService
}
enum UserProfileScreenCoordinatorAction {
case openDirectChat(displayName: String?)
case openDirectChat(roomID: String)
case dismiss
}
final class UserProfileScreenCoordinator: CoordinatorProtocol {
@@ -40,9 +43,11 @@ final class UserProfileScreenCoordinator: CoordinatorProtocol {
init(parameters: UserProfileScreenCoordinatorParameters) {
viewModel = UserProfileScreenViewModel(userID: parameters.userID,
isPresentedModally: parameters.isPresentedModally,
clientProxy: parameters.clientProxy,
mediaProvider: parameters.mediaProvider,
userIndicatorController: parameters.userIndicatorController)
userIndicatorController: parameters.userIndicatorController,
analytics: parameters.analytics)
}
func start() {
@@ -50,8 +55,10 @@ final class UserProfileScreenCoordinator: CoordinatorProtocol {
guard let self else { return }
switch action {
case .openDirectChat(let displayName):
actionsSubject.send(.openDirectChat(displayName: displayName))
case .openDirectChat(let roomID):
actionsSubject.send(.openDirectChat(roomID: roomID))
case .dismiss:
actionsSubject.send(.dismiss)
}
}
.store(in: &cancellables)