marinofaggiana 5 роки тому
батько
коміт
1fb953cbd7

+ 2 - 2
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -3125,7 +3125,7 @@
     OCWebDAVClient *request = [[OCWebDAVClient alloc] init];
     request = [self getRequestWithCredentials:request];
     
-    [request getSetRemoteWipe:serverPath token:self.userID onCommunication:sharedOCComunication success:^(NSHTTPURLResponse * _Nonnull operation, id  _Nonnull response) {
+    [request getSetRemoteWipe:serverPath token:self.password onCommunication:sharedOCComunication success:^(NSHTTPURLResponse * _Nonnull operation, id  _Nonnull response) {
     
         NSData *responseData = (NSData*) response;
         
@@ -3156,7 +3156,7 @@
     OCWebDAVClient *request = [[OCWebDAVClient alloc] init];
     request = [self getRequestWithCredentials:request];
     
-    [request getSetRemoteWipe:serverPath token:self.userID onCommunication:sharedOCComunication success:^(NSHTTPURLResponse * _Nonnull operation, id  _Nonnull response) {
+    [request getSetRemoteWipe:serverPath token:self.password onCommunication:sharedOCComunication success:^(NSHTTPURLResponse * _Nonnull operation, id  _Nonnull response) {
         
         successRequest(response, request.redirectedServer);
         

+ 12 - 7
iOSClient/Networking/OCNetworking.m

@@ -2405,14 +2405,19 @@
 
 - (void)checkRemoteWipe:(NSString *)account
 {
-    [[OCNetworking sharedManager] getRemoteWipeStatusWithAccount:account completion:^(NSString *account, BOOL wipe, NSString *message, NSInteger errorCode) {
-        
-        if (wipe == false) {
-            [CCUtility setPassword:account password:nil];
-        } else {
+    tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesWithAccount:account];
+    if (capabilities != nil && capabilities.versionMajor >= k_nextcloud_version_17_0) {
+        [[OCNetworking sharedManager] getRemoteWipeStatusWithAccount:account completion:^(NSString *account, BOOL wipe, NSString *message, NSInteger errorCode) {
             
-        }
-    }];
+            if (wipe == false) {
+                [CCUtility setPassword:account password:nil];
+            } else {
+                
+            }
+        }];
+    } else {
+        [CCUtility setPassword:account password:nil];
+    }
 }
 
 - (void)getRemoteWipeStatusWithAccount:(NSString *)account completion:(void(^)(NSString *account, BOOL wipe, NSString *message, NSInteger errorCode))completion