Await for room sync only for push notification invites (#3307)

This commit is contained in:
Mauro
2024-09-19 15:42:58 +02:00
committed by GitHub
parent 5d678abd26
commit 943f33b496
4 changed files with 27 additions and 4 deletions
@@ -32,7 +32,8 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
private var userSession: UserSessionProtocol? {
didSet {
userSessionObserver?.cancel()
if userSession != nil {
if let userSession {
userSession.clientProxy.roomsToAwait = storedRoomsToAwait
configureElementCallService()
configureNotificationManager()
observeUserSessionChanges()
@@ -57,6 +58,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
private let appRouteURLParser: AppRouteURLParser
@Consumable private var storedAppRoute: AppRoute?
private var storedRoomsToAwait: Set<String> = []
init(appDelegate: AppDelegate) {
let appHooks = AppHooks()
@@ -303,6 +305,14 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
return
}
if content.categoryIdentifier == NotificationConstants.Category.invite {
if let userSession {
userSession.clientProxy.roomsToAwait.insert(roomID)
} else {
storedRoomsToAwait.insert(roomID)
}
}
handleAppRoute(.room(roomID: roomID, via: []))
}