Marino Faggiana преди 7 години
родител
ревизия
0d72350a2f
променени са 25 файла, в които са добавени 45 реда и са изтрити 52 реда
  1. 1 1
      iOSClient/Brand/NCBrand.swift
  2. 1 1
      iOSClient/Brand/Picker.plist
  3. 1 1
      iOSClient/Brand/PickerFileProvider.plist
  4. 1 1
      iOSClient/Brand/Share.plist
  5. 1 1
      iOSClient/Brand/iOSClient.plist
  6. 13 1
      iOSClient/Favorites/CCFavorites.m
  7. 2 15
      iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLListParser.m
  8. 2 15
      iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLParser.m
  9. 4 0
      iOSClient/Main/CCMain.m
  10. 1 1
      iOSClient/Networking/NCNetworkingSync.m
  11. 0 6
      iOSClient/Networking/OCNetworking.m
  12. 14 7
      iOSClient/Settings/CCManageAccount.m
  13. BIN
      iOSClient/Supporting Files/es.lproj/BKPasscodeView.strings
  14. BIN
      iOSClient/Supporting Files/es.lproj/Intro.strings
  15. BIN
      iOSClient/Supporting Files/es.lproj/Localizable.strings
  16. BIN
      iOSClient/Supporting Files/pt_PT.lproj/BKPasscodeView.strings
  17. BIN
      iOSClient/Supporting Files/pt_PT.lproj/CTAssetsPicker.strings
  18. BIN
      iOSClient/Supporting Files/pt_PT.lproj/Error.strings
  19. BIN
      iOSClient/Supporting Files/pt_PT.lproj/InfoPlist.strings
  20. BIN
      iOSClient/Supporting Files/pt_PT.lproj/Intro.strings
  21. BIN
      iOSClient/Supporting Files/pt_PT.lproj/Localizable.strings
  22. BIN
      iOSClient/Supporting Files/pt_PT.lproj/SwiftWebVC.strings
  23. BIN
      iOSClient/Supporting Files/sk-SK.lproj/Error.strings
  24. BIN
      iOSClient/Supporting Files/sv.lproj/Error.strings
  25. 4 2
      iOSClient/Utility/CCUtility.m

+ 1 - 1
iOSClient/Brand/NCBrand.swift

@@ -68,7 +68,7 @@ class NCBrandColor: NSObject {
     
     @objc public let brand:                           String = "Nextcloud"
     @objc public let mailMe:                          String = "ios@nextcloud.com"
-    @objc public let textCopyrightNextcloudiOS:       String = "Nextcloud for iOS %@ © 2017 T.W.S. Inc."
+    @objc public let textCopyrightNextcloudiOS:       String = "Nextcloud for iOS %@ © 2018 T.W.S. Inc."
     @objc public let textCopyrightNextcloudServer:    String = "Nextcloud Server %@"
     @objc public let loginBaseUrl:                    String = "https://cloud.twsweb.it"
     @objc public let pushNotificationServer:          String = "https://push-notifications.nextcloud.com"

+ 1 - 1
iOSClient/Brand/Picker.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.20.2</string>
+	<string>2.20.3</string>
 	<key>CFBundleVersion</key>
 	<string>00001</string>
 	<key>NSAppTransportSecurity</key>

+ 1 - 1
iOSClient/Brand/PickerFileProvider.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.20.2</string>
+	<string>2.20.3</string>
 	<key>CFBundleVersion</key>
 	<string>00001</string>
 	<key>NSExtension</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.20.2</string>
+	<string>2.20.3</string>
 	<key>CFBundleVersion</key>
 	<string>00001</string>
 	<key>NSAppTransportSecurity</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -46,7 +46,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.20.2</string>
+	<string>2.20.3</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>

+ 13 - 1
iOSClient/Favorites/CCFavorites.m

@@ -33,6 +33,10 @@
 
     NSArray *_dataSource;
     BOOL _reloadDataSource;
+    
+    // Automatic Upload Folder
+    NSString *_autoUploadFileName;
+    NSString *_autoUploadDirectory;
 }
 @end
 
@@ -514,6 +518,10 @@
         
     _dataSource = [NSArray arrayWithArray:metadatas];
     
+    // get auto upload folder
+    _autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
+    _autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:appDelegate.activeUrl];
+    
     [self.tableView reloadData];
 }
 
@@ -577,7 +585,11 @@
     // Immage
     if (metadata.directory) {
             
-        if ([shareLink length] > 0) {
+        if (metadata.e2eEncrypted) {
+            cell.file.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderEncrypted"] color:[NCBrandColor sharedInstance].brandElement];
+        } else if ([metadata.fileName isEqualToString:_autoUploadFileName] && [self.serverUrl isEqualToString:_autoUploadDirectory]) {
+            cell.file.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderphotocamera"] color:[NCBrandColor sharedInstance].brandElement];
+        } else if ([shareLink length] > 0) {
             cell.file.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folder_public"] color:[NCBrandColor sharedInstance].brandElement];
         } else if ([shareUserAndGroup length] > 0) {
             cell.file.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folder_shared_with_me"] color:[NCBrandColor sharedInstance].brandElement];

+ 2 - 15
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLListParser.m

@@ -130,11 +130,8 @@
             [_xmlBucket setObject:lastBit forKey:@"href"];
             _currentFile.fileName = lastBit;
             
-            NSString *decodedFileName = [self decodeFromPercentEscapeString:self.currentFile.fileName];
-            NSString *decodedFilePath = [self decodeFromPercentEscapeString:self.currentFile.filePath];
-            
-            self.currentFile.fileName = [decodedFileName encodeString:NSUTF8StringEncoding];
-            self.currentFile.filePath = [decodedFilePath encodeString:NSUTF8StringEncoding];
+            self.currentFile.fileName = [self.currentFile.fileName stringByRemovingPercentEncoding];
+            self.currentFile.filePath = [self.currentFile.filePath stringByRemovingPercentEncoding];
         }
         
     } else if ([elementName isEqualToString:@"d:getlastmodified"]) {
@@ -210,14 +207,4 @@
     NSLog(@"Finish xml directory list parse");
 }
 
-// Decode a percent escape encoded string.
-- (NSString*) decodeFromPercentEscapeString:(NSString *) string {
-    return (__bridge_transfer NSString *) CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
-                                                                                         (__bridge CFStringRef) string,
-                                                                                         CFSTR(""),
-                                                                                         kCFStringEncodingUTF8);
-}
-
-
-
 @end

+ 2 - 15
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLParser.m

@@ -169,11 +169,8 @@ NSString *OCCWebDAVURIKey           = @"uri";
             _currentFile.fileName = lastBit;
         }
             
-        NSString *decodedFileName = [self decodeFromPercentEscapeString:self.currentFile.fileName];
-        NSString *decodedFilePath = [self decodeFromPercentEscapeString:self.currentFile.filePath];
-            
-        self.currentFile.fileName = [decodedFileName encodeString:NSUTF8StringEncoding];
-        self.currentFile.filePath = [decodedFilePath encodeString:NSUTF8StringEncoding];
+        self.currentFile.fileName = [self.currentFile.fileName stringByRemovingPercentEncoding];
+        self.currentFile.filePath = [self.currentFile.filePath stringByRemovingPercentEncoding];
             
         isNotFirstFileOfList = YES;
 
@@ -253,14 +250,4 @@ NSString *OCCWebDAVURIKey           = @"uri";
     NSLog(@"Finish xml directory list parse");
 }
 
-// Decode a percent escape encoded string.
-- (NSString*) decodeFromPercentEscapeString:(NSString *) string {
-    return (__bridge_transfer NSString *) CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
-                                                                                         (__bridge CFStringRef) string,
-                                                                                         CFSTR(""),
-                                                                                         kCFStringEncodingUTF8);
-}
-
-
-
 @end

+ 4 - 0
iOSClient/Main/CCMain.m

@@ -1637,6 +1637,8 @@
             UIAlertAction *overwriteAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_overwrite_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                 // Send to Upload Queue
                 (void)[[NCManageDatabase sharedInstance] addQueueUploadWithMetadataNet:metadataNet];
+                // Start upload now
+                [appDelegate performSelectorOnMainThread:@selector(loadAutoDownloadUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
             }];
             
             [alertController addAction:cancelAction];
@@ -1652,6 +1654,8 @@
             
             // Send to Upload Queue
             (void)[[NCManageDatabase sharedInstance] addQueueUploadWithMetadataNet:metadataNet];
+            // Start upload now
+            [appDelegate performSelectorOnMainThread:@selector(loadAutoDownloadUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
         }
     }
 }

+ 1 - 1
iOSClient/Networking/NCNetworkingSync.m

@@ -746,7 +746,7 @@
         if (errorDescription == nil) errorDescription = NSLocalizedString(descriptionDefault, @"");
     }
     
-    errorDescription = [NSString stringWithFormat:@"%@ [%ld] - %@", NSLocalizedString(descriptionDefault, @""), errorCode, errorDescription];
+    errorDescription = [NSString stringWithFormat:@"%@ [%ld] - %@", NSLocalizedString(descriptionDefault, @""), (long)errorCode, errorDescription];
 
     if (errorDescription.length >= 250) {
         errorDescription = [errorDescription substringToIndex:250];

+ 0 - 6
iOSClient/Networking/OCNetworking.m

@@ -289,7 +289,6 @@
                 
                 OCFileDto *itemDto = [itemsSortedArray objectAtIndex:i];
                 
-                itemDto.fileName = [itemDto.fileName stringByRemovingPercentEncoding];
                 NSString *fileName = [itemDto.fileName  stringByReplacingOccurrencesOfString:@"/" withString:@""];
                 
                 // Skip hidden files
@@ -394,7 +393,6 @@
             
                 NSString *serverUrl;
 
-                itemDto.fileName = [itemDto.fileName stringByRemovingPercentEncoding];
                 NSString *fileName = [itemDto.fileName  stringByReplacingOccurrencesOfString:@"/" withString:@""];
 
                 // Skip hidden files
@@ -432,7 +430,6 @@
                 /* ---- */
             
                 serverUrl = [CCUtility stringAppendServerUrl:[_activeUrl stringByAppendingString:webDAV] addFileName:serverUrl];
-                serverUrl = [serverUrl stringByRemovingPercentEncoding];
 
                 NSString *directoryID = [[NCManageDatabase sharedInstance] addDirectoryWithServerUrl:serverUrl fileID:itemDto.ocId permissions:itemDto.permissions encrypted:itemDto.isEncrypted];
                 BOOL isFolderEncrypted = [CCUtility isFolderEncrypted:serverUrl account:_metadataNet.account];
@@ -555,8 +552,6 @@
             
             NSString *serverUrl, *fileName;
             
-            itemDto.fileName = [itemDto.fileName stringByRemovingPercentEncoding];
-            itemDto.filePath = [itemDto.filePath stringByRemovingPercentEncoding];
             fileName = [itemDto.fileName  stringByReplacingOccurrencesOfString:@"/" withString:@""];
             
             // Skip hidden files
@@ -595,7 +590,6 @@
             /*      */
             
             serverUrl = [CCUtility stringAppendServerUrl:[_activeUrl stringByAppendingString:webDAV] addFileName:serverUrl];
-            serverUrl = [serverUrl stringByRemovingPercentEncoding];
 
             NSString *directoryID = [[NCManageDatabase sharedInstance] addDirectoryWithServerUrl:serverUrl fileID:itemDto.ocId permissions:itemDto.permissions encrypted:itemDto.isEncrypted];
             BOOL isFolderEncrypted = [CCUtility isFolderEncrypted:serverUrl account:_metadataNet.account];

+ 14 - 7
iOSClient/Settings/CCManageAccount.m

@@ -177,10 +177,18 @@
 {
     [super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
     
-    if ([rowDescriptor.tag isEqualToString:@"pickerAccount"] && oldValue && newValue){
+    if ([rowDescriptor.tag isEqualToString:@"pickerAccount"] && oldValue && newValue) {
         
-        // cambiamo default account se oldvalue != newValue
-        if (![newValue isEqualToString:oldValue]) [self ChangeDefaultAccount:newValue];
+        if (![newValue isEqualToString:oldValue] && ![newValue isEqualToString:@""] && ![newValue isEqualToString:appDelegate.activeAccount])
+            [self ChangeDefaultAccount:newValue];
+        
+        if ([newValue isEqualToString:@""]) {
+            
+            NSArray *listAccount = [[NCManageDatabase sharedInstance] getAccounts];
+
+            if ([listAccount count] > 0)
+                [self ChangeDefaultAccount:listAccount[0]];
+        }
     }
 }
 
@@ -190,9 +198,7 @@
 
 - (void)loginSuccess:(NSInteger)loginType
 {
-    if (loginType == loginAddForced) {
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil];
-    }
+    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil];
 }
 
 - (void)loginClose
@@ -269,7 +275,8 @@
         [self deleteAccount:accountNow];
         
         NSArray *listAccount = [[NCManageDatabase sharedInstance] getAccounts];
-        if ([listAccount count] > 0) [self ChangeDefaultAccount:listAccount[0]];
+        if ([listAccount count] > 0)
+            [self ChangeDefaultAccount:listAccount[0]];
         else {
             [self addAccountForced];
         }

BIN
iOSClient/Supporting Files/es.lproj/BKPasscodeView.strings


BIN
iOSClient/Supporting Files/es.lproj/Intro.strings


BIN
iOSClient/Supporting Files/es.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/pt_PT.lproj/BKPasscodeView.strings


BIN
iOSClient/Supporting Files/pt_PT.lproj/CTAssetsPicker.strings


BIN
iOSClient/Supporting Files/pt_PT.lproj/Error.strings


BIN
iOSClient/Supporting Files/pt_PT.lproj/InfoPlist.strings


BIN
iOSClient/Supporting Files/pt_PT.lproj/Intro.strings


BIN
iOSClient/Supporting Files/pt_PT.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/pt_PT.lproj/SwiftWebVC.strings


BIN
iOSClient/Supporting Files/sk-SK.lproj/Error.strings


BIN
iOSClient/Supporting Files/sv.lproj/Error.strings


+ 4 - 2
iOSClient/Utility/CCUtility.m

@@ -475,12 +475,14 @@
 
 + (BOOL)isEndToEndEnabled:(NSString *)account
 {
+    tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilites];
+
     NSString *publicKey = [self getEndToEndPublicKey:account];
     NSString *privateKey = [self getEndToEndPrivateKey:account];
     NSString *passphrase = [self getEndToEndPassphrase:account];
-    NSString *publicKeyServer = [self getEndToEndPublicKeyServer:account];
+    NSString *publicKeyServer = [self getEndToEndPublicKeyServer:account];    
     
-    if (passphrase.length > 0 && privateKey.length > 0 && publicKey.length > 0 && publicKeyServer.length > 0) {
+    if (passphrase.length > 0 && privateKey.length > 0 && publicKey.length > 0 && publicKeyServer.length > 0 && capabilities.endToEndEncryption) {
         
         return YES;