Feature/4976 fix for blocking behaviour

This commit is contained in:
Frank Rotermund
2023-08-23 15:13:16 +00:00
parent 632889901a
commit 15ca136b4e
5 changed files with 13 additions and 22 deletions
@@ -650,9 +650,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
[MXSDKOptions.sharedInstance.profiler resume];
_isAppForeground = YES;
// bwi: check if requests need to be blocked
[self checkBlockingServerMaintenance];
}
- (void)applicationDidBecomeActive:(UIApplication *)application
@@ -666,9 +663,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
self.isApplicationActiveFromSystemAlert = NO;
[self checkCrossSigningForSession:self.mxSessions.firstObject];
// bwi: check if requests need to be blocked
[self checkBlockingServerMaintenance];
}
- (void)configurePinCodeScreenFor:(UIApplication *)application
@@ -4591,19 +4585,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
[service registerForAppConfig];
}
#pragma mark - bwi blocking maintenance
// bwi: on appstart and app coming back from background check the current maintenance and block requests if necessary
- (void) checkBlockingServerMaintenance {
ServerDowntimeDefaultService* service = [[ServerDowntimeDefaultService alloc] init];
if( [service isDowntimeNow] && [service isBlocking] && ![service isManuallyIgnored] ) {
[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"ServerDownTimeBlockingKey"];
} else {
[NSUserDefaults.standardUserDefaults setBool:NO forKey:@"ServerDownTimeBlockingKey"];
}
}
#pragma mark - Mandatory SSSS setup
- (void)presentSecureBackupSetupForSession:(MXSession*)mxSession