Show ElementCalls in the system Recents list and allow deep linking back into a call from there

This commit is contained in:
Stefan Ceriu
2024-05-27 12:49:24 +03:00
committed by Stefan Ceriu
parent 13a34be157
commit 7b12e95192
10 changed files with 43 additions and 18 deletions

View File

@@ -17,6 +17,7 @@
import AnalyticsEvents
import BackgroundTasks
import Combine
import Intents
import MatrixRustSDK
import SwiftUI
import Version
@@ -236,6 +237,20 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
return false
}
func handleUserActivity(_ userActivity: NSUserActivity) {
// `INStartVideoCallIntent` is to be replaced with `INStartCallIntent`
// but calls from Recents still send it ¯\_()_/¯
guard let intent = userActivity.interaction?.intent as? INStartVideoCallIntent,
let contact = intent.contacts?.first,
let roomIdentifier = contact.personHandle?.value else {
MXLog.error("Failed retrieving information from userActivity: \(userActivity)")
return
}
MXLog.info("Starting call in room: \(roomIdentifier)")
handleAppRoute(AppRoute.call(roomID: roomIdentifier))
}
// MARK: - AuthenticationFlowCoordinatorDelegate
func authenticationFlowCoordinator(didLoginWithSession userSession: UserSessionProtocol) {