Marino Faggiana 8 жил өмнө
parent
commit
f5c693f301

+ 3 - 1
iOSClient/Actions/CCActions.swift

@@ -289,7 +289,9 @@ class CCActions: NSObject {
     
     func search(_ serverUrl : String?, fileName : String, delegate: AnyObject) {
         
-        if (serverUrl == nil) {
+        let versionServer = CCCoreData.getServerVersionActiveAccount(appDelegate.activeAccount)
+        
+        if (versionServer < 12.0) {
             
             let metadataNet: CCMetadataNet = CCMetadataNet.init(account: appDelegate.activeAccount)
 

+ 1 - 0
iOSClient/FileSystem/CCCoreData.h

@@ -74,6 +74,7 @@
 + (BOOL)getCameraUploadWWanPhotoActiveAccount:(NSString *)activeAccount;
 + (BOOL)getCameraUploadWWanVideoActiveAccount:(NSString *)activeAccount;
 + (BOOL)getCameraUploadSaveAlbumActiveAccount:(NSString *)activeAccount;
++ (float)getServerVersionActiveAccount:(NSString *)activeAccount;
 
 + (void)setCameraUpload:(BOOL)state activeAccount:(NSString *)activeAccount;
 + (void)setCameraUploadBackground:(BOOL)state activeAccount:(NSString *)activeAccount;

+ 15 - 0
iOSClient/FileSystem/CCCoreData.m

@@ -304,6 +304,21 @@
     else return NO;
 }
 
++ (float)getServerVersionActiveAccount:(NSString *)activeAccount
+{
+    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(account == %@)", activeAccount];
+    TableAccount *record = [TableAccount MR_findFirstWithPredicate:predicate];
+
+    if (record) {
+        NSInteger versionMajor = [record.versionMajor integerValue];
+        NSInteger versionMinor = [record.versionMinor integerValue];
+        
+        return versionMajor + versionMinor/100;
+
+    } else
+        return 0.0;
+}
+
 + (void)setCameraUpload:(BOOL)state activeAccount:(NSString *)activeAccount
 {
     [MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext) {