|
@@ -188,9 +188,7 @@
|
|
|
//
|
|
|
- (void)applicationWillResignActive:(UIApplication *)application
|
|
|
{
|
|
|
- // Test Maintenance
|
|
|
- if (self.account.length == 0 || self.maintenanceMode)
|
|
|
- return;
|
|
|
+ if (self.account.length == 0) return;
|
|
|
|
|
|
// Dismiss FileViewInFolder
|
|
|
if (self.activeFileViewInFolder != nil ) {
|
|
@@ -207,7 +205,7 @@
|
|
|
//
|
|
|
- (void)applicationWillEnterForeground:(UIApplication *)application
|
|
|
{
|
|
|
- if (self.account.length == 0 || self.maintenanceMode) { return; }
|
|
|
+ if (self.account.length == 0) { return; }
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_applicationWillEnterForeground object:nil];
|
|
|
|
|
@@ -239,7 +237,7 @@
|
|
|
//
|
|
|
- (void)applicationDidBecomeActive:(UIApplication *)application
|
|
|
{
|
|
|
- if (self.account.length == 0 || self.maintenanceMode) { return; }
|
|
|
+ if (self.account.length == 0) { return; }
|
|
|
|
|
|
// Brand
|
|
|
#if defined(HC)
|
|
@@ -263,7 +261,7 @@
|
|
|
//
|
|
|
- (void)applicationDidEnterBackground:(UIApplication *)application
|
|
|
{
|
|
|
- if (self.account.length == 0 || self.maintenanceMode) { return; }
|
|
|
+ if (self.account.length == 0) { return; }
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_applicationDidEnterBackground object:nil];
|
|
|
|
|
@@ -328,8 +326,7 @@
|
|
|
- (void)checkErrorNetworking
|
|
|
{
|
|
|
// test
|
|
|
- if (self.account.length == 0 || self.maintenanceMode)
|
|
|
- return;
|
|
|
+ if (self.account.length == 0) return;
|
|
|
|
|
|
// check unauthorized server (401)
|
|
|
if ([CCUtility getPassword:self.account].length == 0) {
|
|
@@ -529,8 +526,7 @@
|
|
|
- (void)pushNotification
|
|
|
{
|
|
|
// test
|
|
|
- if (self.account.length == 0 || self.maintenanceMode || self.pushKitToken.length == 0)
|
|
|
- return;
|
|
|
+ if (self.account.length == 0 || self.pushKitToken.length == 0) return;
|
|
|
|
|
|
for (tableAccount *result in [[NCManageDatabase sharedInstance] getAllAccount]) {
|
|
|
|
|
@@ -550,8 +546,7 @@
|
|
|
- (void)subscribingNextcloudServerPushNotification:(NSString *)account urlBase:(NSString *)urlBase user:(NSString *)user
|
|
|
{
|
|
|
// test
|
|
|
- if (self.account.length == 0 || self.maintenanceMode || self.pushKitToken.length == 0)
|
|
|
- return;
|
|
|
+ if (self.account.length == 0 || self.pushKitToken.length == 0) return;
|
|
|
|
|
|
[[NCPushNotificationEncryption sharedInstance] generatePushNotificationsKeyPair:account];
|
|
|
|
|
@@ -580,9 +575,7 @@
|
|
|
|
|
|
- (void)unsubscribingNextcloudServerPushNotification:(NSString *)account urlBase:(NSString *)urlBase user:(NSString *)user withSubscribing:(BOOL)subscribing
|
|
|
{
|
|
|
- // test
|
|
|
- if (self.account.length == 0 || self.maintenanceMode)
|
|
|
- return;
|
|
|
+ if (self.account.length == 0) return;
|
|
|
|
|
|
NSString *deviceIdentifier = [CCUtility getPushNotificationDeviceIdentifier:account];
|
|
|
NSString *signature = [CCUtility getPushNotificationDeviceIdentifierSignature:account];
|
|
@@ -715,7 +708,7 @@
|
|
|
|
|
|
- (void)updateApplicationIconBadgeNumber
|
|
|
{
|
|
|
- if (self.account.length == 0 || self.maintenanceMode) return;
|
|
|
+ if (self.account.length == 0) return;
|
|
|
|
|
|
NSInteger counterDownload = [[NCOperationQueue shared] downloadCount];
|
|
|
NSInteger counterUpload = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"status == %d OR status == %d OR status == %d", k_metadataStatusWaitUpload, k_metadataStatusInUpload, k_metadataStatusUploading]].count;
|
|
@@ -740,8 +733,7 @@
|
|
|
|
|
|
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
|
|
{
|
|
|
- // Test Maintenance
|
|
|
- if (self.account.length == 0 || self.maintenanceMode) {
|
|
|
+ if (self.account.length == 0) {
|
|
|
completionHandler(UIBackgroundFetchResultNoData);
|
|
|
return;
|
|
|
}
|
|
@@ -786,8 +778,7 @@
|
|
|
// Method called from iOS system to send a file from other app.
|
|
|
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
|
|
|
{
|
|
|
- if (self.account.length == 0 || self.maintenanceMode)
|
|
|
- return YES;
|
|
|
+ if (self.account.length == 0) return YES;
|
|
|
|
|
|
NSString *scheme = url.scheme;
|
|
|
NSString *fileName;
|
|
@@ -984,13 +975,4 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#pragma --------------------------------------------------------------------------------------------
|
|
|
-#pragma mark ===== Maintenance Mode =====
|
|
|
-#pragma --------------------------------------------------------------------------------------------
|
|
|
-
|
|
|
-- (void)maintenanceMode:(BOOL)mode
|
|
|
-{
|
|
|
- self.maintenanceMode = mode;
|
|
|
-}
|
|
|
-
|
|
|
@end
|