marinofaggiana 5 years ago
parent
commit
9db4a06fde
2 changed files with 19 additions and 1 deletions
  1. 1 1
      Cartfile.resolved
  2. 18 0
      iOSClient/Main/CCMain.m

+ 1 - 1
Cartfile.resolved

@@ -16,7 +16,7 @@ github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.7.1"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
-github "nextcloud/ios-communication-library" "b295ed7852e51bf09d495c95ad655e9f959fd0af"
+github "nextcloud/ios-communication-library" "81bea70b80715dad904d51696cf3dd84120b7697"
 github "realm/realm-cocoa" "v4.4.0"
 github "rechsteiner/Parchment" "v1.7.0"
 github "scenee/FloatingPanel" "v1.7.4"

+ 18 - 0
iOSClient/Main/CCMain.m

@@ -1449,6 +1449,24 @@
     
     NSString *startDirectory = [CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl];
     
+    [[NCCommunication sharedInstance] searchLiteralWithServerUrl:appDelegate.activeUrl user:appDelegate.activeUser depth:@"infinity" literal:_searchFileName account:appDelegate.activeAccount completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
+        
+         if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount]) {
+             
+             
+         } else {
+             
+             if (errorCode != 0) {
+                 [[NCContentPresenter shared] messageNotification:@"_error_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode];
+             } else {
+                 NSLog(@"[LOG] It has been changed user during networking process, error.");
+             }
+             
+             _searchFileName = @"";
+         }
+        
+    }];
+    
     [[OCNetworking sharedManager] searchWithAccount:appDelegate.activeAccount fileName:_searchFileName serverUrl:startDirectory contentType:nil lteDateLastModified:nil gteDateLastModified:nil depth:@"infinity" completion:^(NSString *account, NSArray *metadatas, NSString *message, NSInteger errorCode) {
        
         if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount]) {