Merge branch 'feature/feature/5706_fix_alert_triggering_for_new_users' into 'develop'

MESSENGER-5706 fix alert triggering for new users

See merge request bwmessenger/bundesmessenger/bundesmessenger-ios!329
This commit is contained in:
JanNiklas Grabowski
2024-03-05 14:20:36 +00:00
3 changed files with 35 additions and 5 deletions

View File

@@ -4631,6 +4631,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
{
[secureBackupSetupCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil];
secureBackupSetupCoordinatorBridgePresenter = nil;
// BWI: #5706 fix alert triggering for new users
[self afterAppUnlockedByPin:[UIApplication sharedApplication]];
}
- (void)secureBackupSetupCoordinatorBridgePresenterDelegateDidCancel:(SecureBackupSetupCoordinatorBridgePresenter *)coordinatorBridgePresenter

View File

@@ -767,7 +767,6 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
checkMaintenanceStatus()
enableMaintenanceTimer(true)
self.bwiCheckForMatomoPromt()
BWIAnalytics.sharedTracker.readUserConfig()
if BWIBuildSettings.shared.bwiPersonalNotesRoom {
@@ -775,7 +774,10 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
}
// bwi #4478: refresh wellknown a bit more often
self.currentMatrixSession?.refreshHomeserverWellknown(false, success: nil, failure: nil)
self.currentMatrixSession?.refreshHomeserverWellknown(false, success: { _ in
// bwi: #5706 fix crash: only show matomo alert when wellknown is available
self.bwiCheckForMatomoPromt()
}, failure: nil)
}
}
@@ -800,7 +802,16 @@ extension AllChatsCoordinator: AllChatsViewControllerDelegate {
func allChatsViewControllerDidCompleteAuthentication(_ allChatsViewController: AllChatsViewController) {
self.delegate?.splitViewMasterCoordinatorDidCompleteAuthentication(self)
onBWIAppStart()
// BWI: #5706 fix alert triggering for new users. Only trigger onBWIAppStart when session has recovery set
guard let matrixSession = self.parameters.userSessionsService.mainUserSession?.matrixSession else {
return
}
guard let crypto = matrixSession.crypto else {
return
}
if crypto.recoveryService.hasRecovery() {
onBWIAppStart()
}
}
func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectRoomWithParameters roomNavigationParameters: RoomNavigationParameters, completion: @escaping () -> Void) {

View File

@@ -325,6 +325,10 @@ class AllChatsViewController: HomeViewController {
}
func presentFederationIntroductionSheet() {
guard let mainSession = self.mainSession else {
return
}
guard BWIBuildSettings.shared.showFederationIntroduction else {
return
}
@@ -333,7 +337,11 @@ class AllChatsViewController: HomeViewController {
return
}
guard self.mainSession.homeserverWellknown.shouldShowFederationIntroduction() else {
guard let homeserverWellknown = mainSession.homeserverWellknown else {
return
}
guard homeserverWellknown.shouldShowFederationIntroduction() else {
return
}
@@ -523,7 +531,15 @@ class AllChatsViewController: HomeViewController {
// bwi: 5706 show federation announcement promt
func bwiCheckForFederationAnnouncementPromt() {
guard self.mainSession.homeserverWellknown.shouldShowFederationAnnouncement() else {
guard let mainSession = self.mainSession else {
return
}
guard let homeserverWellknown = mainSession.homeserverWellknown else {
return
}
guard homeserverWellknown.shouldShowFederationAnnouncement() else {
return
}