mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Remove GenericCallLinkCoordinator, merging it into CallScreen. (#3181)
* Remove incorrect message send call and fix typo. * Add overlay coordinator presentation to the NavigationRootCoordinator. * Remove GenericCallLinkCoordinator, merging it into CallScreen. This will allow for picture in picture on call links when available.
This commit is contained in:
@@ -212,7 +212,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
if let userSessionFlowCoordinator {
|
||||
userSessionFlowCoordinator.handleAppRoute(route, animated: true)
|
||||
} else {
|
||||
navigationRootCoordinator.setSheetCoordinator(GenericCallLinkCoordinator(parameters: .init(url: url)))
|
||||
presentCallScreen(genericCallLink: url)
|
||||
}
|
||||
case .userProfile(let userID):
|
||||
if isExternalURL {
|
||||
@@ -648,6 +648,31 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
|
||||
elementCallService.setClientProxy(userSession.clientProxy)
|
||||
}
|
||||
|
||||
private func presentCallScreen(genericCallLink url: URL) {
|
||||
let configuration = ElementCallConfiguration(genericCallLink: url)
|
||||
|
||||
let callScreenCoordinator = CallScreenCoordinator(parameters: .init(elementCallService: elementCallService,
|
||||
configuration: configuration,
|
||||
elementCallPictureInPictureEnabled: false,
|
||||
appHooks: appHooks))
|
||||
|
||||
callScreenCoordinator.actions
|
||||
.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
switch action {
|
||||
case .pictureInPictureStarted, .pictureInPictureStopped:
|
||||
// Don't allow PiP when signed out - the user could login at which point we'd
|
||||
// need to hand over the call from here to the user session flow coordinator.
|
||||
MXLog.error("Picture in Picture not supported before login.")
|
||||
case .dismiss:
|
||||
navigationRootCoordinator.setOverlayCoordinator(nil)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
navigationRootCoordinator.setOverlayCoordinator(callScreenCoordinator, animated: false)
|
||||
}
|
||||
|
||||
private func configureNotificationManager() {
|
||||
notificationManager.setUserSession(userSession)
|
||||
|
||||
Reference in New Issue
Block a user