marinofaggiana пре 4 година
родитељ
комит
d819c7bbbb

+ 0 - 6
iOSClient/AppDelegate.h

@@ -119,9 +119,6 @@
 // Shares
 @property (nonatomic, strong) NSArray *shares;
 
-// Maintenance Mode
-@property BOOL maintenanceMode;
-
 // UserDefaults
 @property (nonatomic, strong) NSUserDefaults *ncUserDefaults;
 
@@ -140,8 +137,5 @@
 // Push Notification
 - (void)pushNotification;
 
-// Maintenance Mode
-- (void)maintenanceMode:(BOOL)mode;
-
 @end
 

+ 11 - 29
iOSClient/AppDelegate.m

@@ -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

+ 1 - 3
iOSClient/AutoUpload/NCAutoUpload.m

@@ -332,9 +332,7 @@
 
 - (void)uploadAssetsNewAndFull:(NSString *)selector
 {
-    if (!appDelegate.account || appDelegate.maintenanceMode) {
-         return;
-    }
+    if (!appDelegate.account) return;
     
     tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountActive];
     if (tableAccount == nil) {

+ 0 - 1
iOSClient/Main/NCMainTabBar.swift

@@ -201,7 +201,6 @@ import Foundation
     // Menu Button Touch Action
     @objc func centerButtonAction(sender: UIButton) {
         
-        if appDelegate.maintenanceMode { return }
         if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, appDelegate.activeServerUrl)) {
             
             if !directory.permissions.contains("CK") {

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -649,7 +649,7 @@ extension NCMedia {
     
     @objc func reloadDataSourceWithCompletion(_ completion: @escaping (_ metadatas: [tableMetadata]) -> Void) {
         
-        if (appDelegate.account == nil || appDelegate.account.count == 0 || appDelegate.maintenanceMode == true) { return }
+        if (appDelegate.account == nil || appDelegate.account.count == 0) { return }
         
         if account != appDelegate.account {
             self.metadatas = []

+ 1 - 3
iOSClient/Networking/NCNetworkingAutoUpload.swift

@@ -51,9 +51,7 @@ class NCNetworkingAutoUpload: NSObject {
         var maxConcurrentOperationUpload = 5
         let sessionSelectors = [selectorUploadFile, selectorUploadAutoUpload, selectorUploadAutoUploadAll]
         
-        if appDelegate.account == nil || appDelegate.account.count == 0 || appDelegate.maintenanceMode {
-            return
-        }
+        if appDelegate.account == nil || appDelegate.account.count == 0 { return }
         
         let metadatasUpload = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "status == %d OR status == %d", k_metadataStatusInUpload, k_metadataStatusUploading))
         counterUpload = metadatasUpload.count

+ 3 - 9
iOSClient/Networking/NCService.swift

@@ -37,9 +37,7 @@ class NCService: NSObject {
     
     @objc public func startRequestServicesServer() {
    
-        if (appDelegate.account == nil || appDelegate.account.count == 0 || appDelegate.maintenanceMode == true) {
-            return
-        }
+        if (appDelegate.account == nil || appDelegate.account.count == 0) { return }
         
         self.requestUserProfile()
         self.requestServerStatus()
@@ -49,9 +47,7 @@ class NCService: NSObject {
     
     private func requestUserProfile() {
         
-        if (appDelegate.account == nil || appDelegate.account.count == 0 || appDelegate.maintenanceMode == true) {
-            return
-        }
+        if (appDelegate.account == nil || appDelegate.account.count == 0) { return }
         
         NCCommunication.shared.getUserProfile() { (account, userProfile, errorCode, errorDescription) in
                
@@ -142,9 +138,7 @@ class NCService: NSObject {
     
     private func requestServerCapabilities() {
         
-        if (appDelegate.account == nil || appDelegate.account.count == 0 || appDelegate.maintenanceMode == true) {
-            return
-        }
+        if (appDelegate.account == nil || appDelegate.account.count == 0) { return }
         
         NCCommunication.shared.getCapabilities() { (account, data, errorCode, errorDescription) in
             

+ 0 - 4
iOSClient/Settings/CCAdvanced.m

@@ -316,8 +316,6 @@
 
 - (void)clearCache
 {
-    [appDelegate maintenanceMode:YES];
-    
     [[NCNetworking shared] cancelAllTransferWithAccount:appDelegate.account completion:^{ }];
     [[NCOperationQueue shared] cancelAllQueue];
 
@@ -337,8 +335,6 @@
 
     [[NCAutoUpload sharedInstance] alignPhotoLibrary];
 
-    [appDelegate maintenanceMode:NO];
-
     // Inizialized home
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_initializeMain object:nil userInfo:nil];