Browse Source

Version 6.1.4 (#3168)

Marino Faggiana 5 months ago
parent
commit
c38d042fe5
100 changed files with 245 additions and 106 deletions
  1. 2 2
      File Provider Extension/FileProviderEnumerator.swift
  2. 21 5
      Nextcloud.xcodeproj/project.pbxproj
  3. 3 2
      Share/NCShareCell.swift
  4. 1 1
      Share/NCShareExtension+DataSource.swift
  5. 13 9
      Share/NCShareExtension+NCAccountRequestDelegate.swift
  6. 36 9
      Share/NCShareExtension.swift
  7. 4 0
      iOSClient/Data/NCManageDatabase+Metadata.swift
  8. 85 57
      iOSClient/Extensions/UIAlertController+Extension.swift
  9. 7 2
      iOSClient/Main/Collection Common/NCCollectionViewCommon+MediaLayout.swift
  10. 2 2
      iOSClient/Main/Collection Common/NCCollectionViewCommon+SelectTabBar.swift
  11. 33 2
      iOSClient/Main/NCDragDrop.swift
  12. 34 13
      iOSClient/Main/NCPickerViewController.swift
  13. 1 0
      iOSClient/NCGlobal.swift
  14. 0 1
      iOSClient/Scan document/NCUploadScanDocument.swift
  15. BIN
      iOSClient/Supporting Files/af.lproj/Localizable.strings
  16. BIN
      iOSClient/Supporting Files/an.lproj/Localizable.strings
  17. BIN
      iOSClient/Supporting Files/ar.lproj/Localizable.strings
  18. BIN
      iOSClient/Supporting Files/ast.lproj/Localizable.strings
  19. BIN
      iOSClient/Supporting Files/az.lproj/Localizable.strings
  20. BIN
      iOSClient/Supporting Files/be.lproj/Localizable.strings
  21. BIN
      iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings
  22. BIN
      iOSClient/Supporting Files/bn_BD.lproj/Localizable.strings
  23. BIN
      iOSClient/Supporting Files/br.lproj/Localizable.strings
  24. BIN
      iOSClient/Supporting Files/bs.lproj/Localizable.strings
  25. BIN
      iOSClient/Supporting Files/ca.lproj/Localizable.strings
  26. BIN
      iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings
  27. BIN
      iOSClient/Supporting Files/cy_GB.lproj/Localizable.strings
  28. BIN
      iOSClient/Supporting Files/da.lproj/Localizable.strings
  29. BIN
      iOSClient/Supporting Files/de.lproj/Localizable.strings
  30. BIN
      iOSClient/Supporting Files/el.lproj/Localizable.strings
  31. BIN
      iOSClient/Supporting Files/en-GB.lproj/Localizable.strings
  32. 3 1
      iOSClient/Supporting Files/en.lproj/Localizable.strings
  33. BIN
      iOSClient/Supporting Files/eo.lproj/Localizable.strings
  34. BIN
      iOSClient/Supporting Files/es-419.lproj/Localizable.strings
  35. BIN
      iOSClient/Supporting Files/es-AR.lproj/Localizable.strings
  36. BIN
      iOSClient/Supporting Files/es-CL.lproj/Localizable.strings
  37. BIN
      iOSClient/Supporting Files/es-CO.lproj/Localizable.strings
  38. BIN
      iOSClient/Supporting Files/es-CR.lproj/Localizable.strings
  39. BIN
      iOSClient/Supporting Files/es-DO.lproj/Localizable.strings
  40. BIN
      iOSClient/Supporting Files/es-EC.lproj/Localizable.strings
  41. BIN
      iOSClient/Supporting Files/es-GT.lproj/Localizable.strings
  42. BIN
      iOSClient/Supporting Files/es-HN.lproj/Localizable.strings
  43. BIN
      iOSClient/Supporting Files/es-MX.lproj/Localizable.strings
  44. BIN
      iOSClient/Supporting Files/es-NI.lproj/Localizable.strings
  45. BIN
      iOSClient/Supporting Files/es-PA.lproj/Localizable.strings
  46. BIN
      iOSClient/Supporting Files/es-PE.lproj/Localizable.strings
  47. BIN
      iOSClient/Supporting Files/es-PR.lproj/Localizable.strings
  48. BIN
      iOSClient/Supporting Files/es-PY.lproj/Localizable.strings
  49. BIN
      iOSClient/Supporting Files/es-SV.lproj/Localizable.strings
  50. BIN
      iOSClient/Supporting Files/es-UY.lproj/Localizable.strings
  51. BIN
      iOSClient/Supporting Files/es.lproj/Localizable.strings
  52. BIN
      iOSClient/Supporting Files/et_EE.lproj/Localizable.strings
  53. BIN
      iOSClient/Supporting Files/eu.lproj/Localizable.strings
  54. BIN
      iOSClient/Supporting Files/fa.lproj/Localizable.strings
  55. BIN
      iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings
  56. BIN
      iOSClient/Supporting Files/fo.lproj/Localizable.strings
  57. BIN
      iOSClient/Supporting Files/fr.lproj/Localizable.strings
  58. BIN
      iOSClient/Supporting Files/ga.lproj/Localizable.strings
  59. BIN
      iOSClient/Supporting Files/gd.lproj/Localizable.strings
  60. BIN
      iOSClient/Supporting Files/gl.lproj/Localizable.strings
  61. BIN
      iOSClient/Supporting Files/he.lproj/Localizable.strings
  62. BIN
      iOSClient/Supporting Files/hi_IN.lproj/Localizable.strings
  63. BIN
      iOSClient/Supporting Files/hr.lproj/Localizable.strings
  64. BIN
      iOSClient/Supporting Files/hsb.lproj/Localizable.strings
  65. BIN
      iOSClient/Supporting Files/hu.lproj/Localizable.strings
  66. BIN
      iOSClient/Supporting Files/hy.lproj/Localizable.strings
  67. BIN
      iOSClient/Supporting Files/ia.lproj/Localizable.strings
  68. BIN
      iOSClient/Supporting Files/id.lproj/Localizable.strings
  69. BIN
      iOSClient/Supporting Files/ig.lproj/Localizable.strings
  70. BIN
      iOSClient/Supporting Files/is.lproj/Localizable.strings
  71. BIN
      iOSClient/Supporting Files/it.lproj/Localizable.strings
  72. BIN
      iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings
  73. BIN
      iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings
  74. BIN
      iOSClient/Supporting Files/ka.lproj/Localizable.strings
  75. BIN
      iOSClient/Supporting Files/kab.lproj/Localizable.strings
  76. BIN
      iOSClient/Supporting Files/km.lproj/Localizable.strings
  77. BIN
      iOSClient/Supporting Files/kn.lproj/Localizable.strings
  78. BIN
      iOSClient/Supporting Files/ko.lproj/Localizable.strings
  79. BIN
      iOSClient/Supporting Files/la.lproj/Localizable.strings
  80. BIN
      iOSClient/Supporting Files/lb.lproj/Localizable.strings
  81. BIN
      iOSClient/Supporting Files/lo.lproj/Localizable.strings
  82. BIN
      iOSClient/Supporting Files/lt_LT.lproj/Localizable.strings
  83. BIN
      iOSClient/Supporting Files/lv.lproj/InfoPlist.strings
  84. BIN
      iOSClient/Supporting Files/lv.lproj/Localizable.strings
  85. BIN
      iOSClient/Supporting Files/mk.lproj/Localizable.strings
  86. BIN
      iOSClient/Supporting Files/mn.lproj/Localizable.strings
  87. BIN
      iOSClient/Supporting Files/mr.lproj/Localizable.strings
  88. BIN
      iOSClient/Supporting Files/ms_MY.lproj/Localizable.strings
  89. BIN
      iOSClient/Supporting Files/my.lproj/Localizable.strings
  90. BIN
      iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings
  91. BIN
      iOSClient/Supporting Files/ne.lproj/Localizable.strings
  92. BIN
      iOSClient/Supporting Files/nl.lproj/Localizable.strings
  93. BIN
      iOSClient/Supporting Files/nn_NO.lproj/Localizable.strings
  94. BIN
      iOSClient/Supporting Files/oc.lproj/Localizable.strings
  95. BIN
      iOSClient/Supporting Files/pl.lproj/Localizable.strings
  96. BIN
      iOSClient/Supporting Files/ps.lproj/Localizable.strings
  97. BIN
      iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings
  98. BIN
      iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings
  99. BIN
      iOSClient/Supporting Files/ro.lproj/Localizable.strings
  100. BIN
      iOSClient/Supporting Files/ru.lproj/Localizable.strings

+ 2 - 2
File Provider Extension/FileProviderEnumerator.swift

@@ -40,7 +40,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             serverUrl = NCUtilityFileSystem().getHomeServer(session: fileProviderData.shared.session)
         } else {
             if let metadata = providerUtility.getTableMetadataFromItemIdentifier(enumeratedItemIdentifier),
-               let directorySource = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
+               let directorySource = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND NOT (status IN %@)", metadata.account, metadata.serverUrl, NCGlobal.shared.metadataStatusHideInFileExtension)) {
                 serverUrl = directorySource.serverUrl + "/" + metadata.fileName
 
             }
@@ -158,7 +158,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
     }
 
     func fetchItemsForPage(serverUrl: String, pageNumber: Int, completionHandler: @escaping (_ metadatas: Results<tableMetadata>?) -> Void) {
-        let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@", fileProviderData.shared.session.account, serverUrl)
+        let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND NOT (status IN %@)", fileProviderData.shared.session.account, serverUrl, NCGlobal.shared.metadataStatusHideInFileExtension)
 
         if pageNumber == 1 {
             NextcloudKit.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: NCKeychain().showHiddenFiles, account: fileProviderData.shared.session.account) { _, files, _, error in

+ 21 - 5
Nextcloud.xcodeproj/project.pbxproj

@@ -148,6 +148,13 @@
 		F37208C62BAB63F0006B5430 /* LRUCache in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C52BAB63F0006B5430 /* LRUCache */; };
 		F37208C82BAB63F1006B5430 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C72BAB63F1006B5430 /* KeychainAccess */; };
 		F38F71252B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F38F71242B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift */; };
+		F39170A92CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
+		F39170AA2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
+		F39170AB2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
+		F39170AC2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
+		F39170AD2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
+		F39170AE2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
+		F39170AF2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
 		F39298972A3B12CB00509762 /* BaseNCMoreCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39298962A3B12CB00509762 /* BaseNCMoreCell.swift */; };
 		F3953BD72A6E87E000EE03F9 /* BaseIntegrationXCTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3953BD62A6E87E000EE03F9 /* BaseIntegrationXCTestCase.swift */; };
 		F3A047972BD2668800658E7B /* NCAssistantEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3A0478F2BD2668800658E7B /* NCAssistantEmptyView.swift */; };
@@ -1204,6 +1211,7 @@
 		F37208742BAB4AB0006B5430 /* TestConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestConstants.swift; sourceTree = "<group>"; };
 		F37208772BAB4B5D006B5430 /* BaseXCTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseXCTestCase.swift; sourceTree = "<group>"; };
 		F38F71242B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCollectionViewCommonSelectTabBar.swift; sourceTree = "<group>"; };
+		F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileAutoRenamer+Extensions.swift"; sourceTree = "<group>"; };
 		F39298962A3B12CB00509762 /* BaseNCMoreCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseNCMoreCell.swift; sourceTree = "<group>"; };
 		F3953BD62A6E87E000EE03F9 /* BaseIntegrationXCTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseIntegrationXCTestCase.swift; sourceTree = "<group>"; };
 		F3998E192B4879B2007CA5DE /* CoreAudioTypes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudioTypes.framework; path = System/Library/Frameworks/CoreAudioTypes.framework; sourceTree = SDKROOT; };
@@ -2849,6 +2857,7 @@
 				F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */,
 				F33EE6F12BF4C9B200CA1A51 /* PKCS12.swift */,
 				F33918C32C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift */,
+				F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */,
 			);
 			path = Utility;
 			sourceTree = "<group>";
@@ -4017,6 +4026,7 @@
 			files = (
 				F73EF7BD2B0224AB0087E6E9 /* NCManageDatabase+ExternalSites.swift in Sources */,
 				F71433E72C778FFB00E20B5A /* NotificationCenter+MainThread.swift in Sources */,
+				F39170AA2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
 				F73EF7C52B02250B0087E6E9 /* NCManageDatabase+GPS.swift in Sources */,
 				2C1D5D7923E2DE9100334ABB /* NCBrand.swift in Sources */,
 				F770768A263A8A2500A1BA94 /* NCUtilityFileSystem.swift in Sources */,
@@ -4151,6 +4161,7 @@
 				F757CC8729E7F88B00F31428 /* NCManageDatabase+Groupfolders.swift in Sources */,
 				F33EE6F72BF4C9B200CA1A51 /* PKCS12.swift in Sources */,
 				F7B769AD2B7A0B2000C1AAEB /* NCManageDatabase+Metadata+Session.swift in Sources */,
+				F39170AC2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
 				F73EF7BC2B0224AB0087E6E9 /* NCManageDatabase+ExternalSites.swift in Sources */,
 				F724377E2C10B92300C7C68D /* NCPermissions.swift in Sources */,
 				F73EF7B42B0224350087E6E9 /* NCManageDatabase+DirectEditing.swift in Sources */,
@@ -4232,6 +4243,7 @@
 				F7BD71E62636EAFC00643C34 /* NCNetworkingE2EE.swift in Sources */,
 				F7F878AF1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */,
 				F7327E3B2B73B8D600A462C7 /* Array+Extension.swift in Sources */,
+				F39170AF2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
 				F799DF832C4B7DCC003410B5 /* NCSectionFooter.swift in Sources */,
 				AF22B218277D196700DAB0CC /* NCShareExtension+Files.swift in Sources */,
 				F799DF862C4B7E56003410B5 /* NCSectionHeader.swift in Sources */,
@@ -4306,6 +4318,7 @@
 				F73EF7D02B0225BA0087E6E9 /* NCManageDatabase+Tag.swift in Sources */,
 				F783030228B4C4B800B84583 /* NCUtility.swift in Sources */,
 				F711D63128F44801003F43C8 /* IntentHandler.swift in Sources */,
+				F39170AE2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
 				F76DEE9728F808AF0041B1C9 /* LockscreenData.swift in Sources */,
 				F72EA95A28B7BD0D00C88F0C /* FilesWidgetView.swift in Sources */,
 				F768823C2C0DD231001CF441 /* NCKeychain.swift in Sources */,
@@ -4449,6 +4462,7 @@
 				F7BFFD2C2C8854690029A201 /* NCHud.swift in Sources */,
 				F771E3F820E239B500AFB62D /* FileProviderExtension+Thumbnail.swift in Sources */,
 				F76882392C0DD230001CF441 /* NCKeychain.swift in Sources */,
+				F39170AB2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
 				F343A4BF2A1E734600DDA874 /* Optional+Extension.swift in Sources */,
 				AF4BF62027562B3F0081CEEF /* NCManageDatabase+Activity.swift in Sources */,
 				F73ADD2226554FD10069EA0D /* NCContentPresenter.swift in Sources */,
@@ -4467,6 +4481,7 @@
 				F7E7AEA72BA32D0000512E52 /* NCCollectionViewUnifiedSearch.swift in Sources */,
 				F73EF7A72B0223900087E6E9 /* NCManageDatabase+Comments.swift in Sources */,
 				F33918C42C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift in Sources */,
+				F39170AD2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
 				F799DF882C4B83CC003410B5 /* NCCollectionViewCommon+EasyTipView.swift in Sources */,
 				F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */,
 				F77DD6A82C5CC093009448FB /* NCSession.swift in Sources */,
@@ -4770,6 +4785,7 @@
 				F7C9B91F2B582F550064EA91 /* NCManageDatabase+SecurityGuard.swift in Sources */,
 				F75DD767290ABB25002EB562 /* Intent.intentdefinition in Sources */,
 				F72437812C10B92500C7C68D /* NCPermissions.swift in Sources */,
+				F39170A92CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */,
 				F749B64C297B0CBB00087535 /* NCManageDatabase+Share.swift in Sources */,
 				F7A8D73F28F181EF008BBE1C /* NCGlobal.swift in Sources */,
 				F74B6D972A7E239A00F03C5F /* NCManageDatabase+Chunk.swift in Sources */,
@@ -5682,7 +5698,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 0;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -5709,7 +5725,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 6.1.3;
+				MARKETING_VERSION = 6.1.4;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = "-v";
 				OTHER_LDFLAGS = "";
@@ -5748,7 +5764,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 0;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -5772,7 +5788,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 6.1.3;
+				MARKETING_VERSION = 6.1.4;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = "-v";
 				OTHER_LDFLAGS = "";
@@ -6047,7 +6063,7 @@
 			repositoryURL = "https://github.com/nextcloud/NextcloudKit";
 			requirement = {
 				kind = exactVersion;
-				version = 5.0.0;
+				version = 5.0.1;
 			};
 		};
 		F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {

+ 3 - 2
Share/NCShareCell.swift

@@ -27,7 +27,8 @@ import NextcloudKit
 protocol NCShareCellDelegate: AnyObject {
     var uploadStarted: Bool { get }
     func removeFile(named fileName: String)
-    func renameFile(named fileName: String, account: String)
+    func showRenameFileDialog(named fileName: String, account: String)
+    func renameFile(oldName: String, newName: String, account: String)
 }
 
 class NCShareCell: UITableViewCell {
@@ -71,7 +72,7 @@ class NCShareCell: UITableViewCell {
         let alertController = UIAlertController(title: "", message: fileName, preferredStyle: .alert)
 
         alertController.addAction(UIAlertAction(title: NSLocalizedString("_rename_file_", comment: ""), style: .default) { _ in
-            self.delegate?.renameFile(named: self.fileName, account: self.account)
+            self.delegate?.showRenameFileDialog(named: self.fileName, account: self.account)
         })
 
         alertController.addAction(UIAlertAction(title: NSLocalizedString("_remove_file_", comment: ""), style: .default) { _ in

+ 1 - 1
Share/NCShareExtension+DataSource.swift

@@ -176,7 +176,7 @@ extension NCShareExtension: UITableViewDelegate {
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         guard !uploadStarted else { return }
         let fileName = filesName[indexPath.row]
-        renameFile(named: fileName, account: session.account)
+        showRenameFileDialog(named: fileName, account: session.account)
     }
 }
 

+ 13 - 9
Share/NCShareExtension+NCAccountRequestDelegate.swift

@@ -111,21 +111,25 @@ extension NCShareExtension: NCCreateFormUploadConflictDelegate {
 }
 
 extension NCShareExtension: NCShareCellDelegate {
-    func renameFile(named fileName: String, account: String) {
+    func showRenameFileDialog(named fileName: String, account: String) {
         let alert = UIAlertController.renameFile(fileName: fileName, account: account) { [self] newFileName in
-            guard let fileIx = self.filesName.firstIndex(of: fileName),
-                  !self.filesName.contains(newFileName),
-                  utilityFileSystem.moveFile(atPath: (NSTemporaryDirectory() + fileName), toPath: (NSTemporaryDirectory() + newFileName)) else {
-                      return showAlert(title: "_single_file_conflict_title_", description: "'\(fileName)' -> '\(newFileName)'")
-                  }
-
-            filesName[fileIx] = newFileName
-            tableView.reloadData()
+            renameFile(oldName: fileName, newName: newFileName, account: account)
         }
 
         present(alert, animated: true)
     }
 
+    func renameFile(oldName: String, newName: String, account: String) {
+        guard let fileIx = self.filesName.firstIndex(of: oldName),
+              !self.filesName.contains(newName),
+              utilityFileSystem.moveFile(atPath: (NSTemporaryDirectory() + oldName), toPath: (NSTemporaryDirectory() + newName)) else {
+            return showAlert(title: "_single_file_conflict_title_", description: "'\(oldName)' -> '\(newName)'")
+        }
+
+        filesName[fileIx] = newName
+        tableView.reloadData()
+    }
+
     func removeFile(named fileName: String) {
         guard let index = self.filesName.firstIndex(of: fileName) else {
             return showAlert(title: "_file_not_found_", description: fileName)

+ 36 - 9
Share/NCShareExtension.swift

@@ -285,17 +285,41 @@ extension NCShareExtension {
         guard !filesName.isEmpty else { return showAlert(description: "_files_no_files_") }
 
         counterUploaded = 0
-        uploadStarted = true
         uploadErrors = []
+        var dismissAfterUpload = true
 
         var conflicts: [tableMetadata] = []
-        for fileName in filesName {
-            if let fileNameError = FileNameValidator.shared.checkFileName(fileName, account: session.account) {
-                present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))"), animated: true)
+        var invalidNameIndexes: [Int] = []
+
+        for (index, fileName) in filesName.enumerated() {
+            let newFileName = FileAutoRenamer.shared.rename(fileName, account: session.account)
+
+            if fileName != newFileName {
+                renameFile(oldName: fileName, newName: newFileName, account: session.account)
+            }
+
+            if let fileNameError = FileNameValidator.shared.checkFileName(newFileName, account: session.account) {
+                if filesName.count == 1 {
+                    showRenameFileDialog(named: fileName, account: account)
+                    return
+                } else {
+                    present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))") {
+                        self.extensionContext?.completeRequest(returningItems: self.extensionContext?.inputItems, completionHandler: nil)
+                    }, animated: true)
+
+                    invalidNameIndexes.append(index)
+                    dismissAfterUpload = false
+                    continue
+                }
 
-                continue
             }
+        }
+
+        for index in invalidNameIndexes.reversed() {
+            filesName.remove(at: index)
+        }
 
+        for fileName in filesName {
             let ocId = NSUUID().uuidString
             let toPath = utilityFileSystem.getDirectoryProviderStorageOcId(ocId, fileNameView: fileName)
             guard utilityFileSystem.copyFile(atPath: (NSTemporaryDirectory() + fileName), toPath: toPath) else { continue }
@@ -320,6 +344,8 @@ extension NCShareExtension {
             }
         }
 
+        tableView.reloadData()
+
         if !conflicts.isEmpty {
             guard let conflict = UIStoryboard(name: "NCCreateFormUploadConflict", bundle: nil).instantiateInitialViewController() as? NCCreateFormUploadConflict
             else { return }
@@ -330,13 +356,14 @@ extension NCShareExtension {
             conflict.delegate = self
             self.present(conflict, animated: true, completion: nil)
         } else {
-            upload()
+            uploadStarted = true
+            upload(dismissAfterUpload: dismissAfterUpload)
         }
     }
 
-    func upload() {
+    func upload(dismissAfterUpload: Bool = true) {
         guard uploadStarted else { return }
-        guard uploadMetadata.count > counterUploaded else { return DispatchQueue.main.async { self.finishedUploading() } }
+        guard uploadMetadata.count > counterUploaded else { return DispatchQueue.main.async { self.finishedUploading(dismissAfterUpload: dismissAfterUpload) } }
         let metadata = uploadMetadata[counterUploaded]
         let results = NextcloudKit.shared.nkCommonInstance.getInternalType(fileName: metadata.fileNameView, mimeType: metadata.contentType, directory: false, account: session.account)
 
@@ -374,7 +401,7 @@ extension NCShareExtension {
         }
     }
 
-    func finishedUploading() {
+    func finishedUploading(dismissAfterUpload: Bool = true) {
         uploadStarted = false
         if !uploadErrors.isEmpty {
             let fileList = "- " + uploadErrors.map({ $0.fileName }).joined(separator: "\n  - ")

+ 4 - 0
iOSClient/Data/NCManageDatabase+Metadata.swift

@@ -253,6 +253,10 @@ extension tableMetadata {
         status == NCGlobal.shared.metadataStatusWaitUpload || status == NCGlobal.shared.metadataStatusUploading
     }
 
+    var isDirectory: Bool {
+        directory
+    }
+
     @objc var isDirectoryE2EE: Bool {
         let session = NCSession.Session(account: account, urlBase: urlBase, user: user, userId: userId)
         return NCUtilityFileSystem().isDirectoryE2EE(session: session, serverUrl: serverUrl)

+ 85 - 57
iOSClient/Extensions/UIAlertController+Extension.swift

@@ -39,6 +39,9 @@ extension UIAlertController {
         let okAction = UIAlertAction(title: NSLocalizedString("_save_", comment: ""), style: .default, handler: { _ in
             guard let fileNameFolder = alertController.textFields?.first?.text else { return }
             if markE2ee {
+                if NCNetworking.shared.isOffline {
+                    return NCContentPresenter().showInfo(error: NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_offline_not_allowed_"))
+                }
                 Task {
                     let createFolderResults = await NCNetworking.shared.createFolder(serverUrlFileName: serverUrl + "/" + fileNameFolder, account: session.account)
                     if createFolderResults.error == .success {
@@ -51,17 +54,28 @@ extension UIAlertController {
                     }
                 }
             } else if isDirectoryEncrypted {
+                if NCNetworking.shared.isOffline {
+                    return NCContentPresenter().showInfo(error: NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_offline_not_allowed_"))
+                }
+                #if !EXTENSION
                 Task {
                     await NCNetworkingE2EECreateFolder().createFolder(fileName: fileNameFolder, serverUrl: serverUrl, withPush: true, sceneIdentifier: sceneIdentifier, session: session)
                 }
+                #endif
             } else {
-                NCNetworking.shared.createFolder(fileName: fileNameFolder, serverUrl: serverUrl, overwrite: false, withPush: true, sceneIdentifier: sceneIdentifier, session: session) { error in
-                    if let completion = completion {
-                        DispatchQueue.main.async { completion(error) }
-                    } else if error != .success {
-                        NCContentPresenter().showError(error: error)
-                    } // else: successful, no action
-                }
+                let metadataForCreateFolder = NCManageDatabase.shared.createMetadata(fileName: fileNameFolder,
+                                                                                     fileNameView: fileNameFolder,
+                                                                                     ocId: NSUUID().uuidString,
+                                                                                     serverUrl: serverUrl,
+                                                                                     url: "",
+                                                                                     contentType: "httpd/unix-directory",
+                                                                                     directory: true,
+                                                                                     session: session,
+                                                                                     sceneIdentifier: sceneIdentifier)
+                metadataForCreateFolder.status = NCGlobal.shared.metadataStatusWaitCreateFolder
+                metadataForCreateFolder.sessionDate = Date()
+                NCManageDatabase.shared.addMetadata(metadataForCreateFolder)
+                NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterCreateFolder, userInfo: ["ocId": metadataForCreateFolder.ocId, "serverUrl": metadataForCreateFolder.serverUrl, "account": metadataForCreateFolder.account, "withPush": true, "sceneIdentifier": sceneIdentifier as Any])
             }
         })
 
@@ -81,9 +95,28 @@ extension UIAlertController {
                 guard let text = alertController.textFields?.first?.text else { return }
                 let folderName = text.trimmingCharacters(in: .whitespaces)
 
+                let newExtension = text.fileExtension
+                let isFileHidden = FileNameValidator.shared.isFileHidden(text)
                 let textCheck = FileNameValidator.shared.checkFileName(folderName, account: session.account)
-                okAction.isEnabled = textCheck?.error == nil && !folderName.isEmpty
-                alertController.message = textCheck?.error.localizedDescription
+
+                okAction.isEnabled = !text.isEmpty && textCheck?.error == nil
+
+                var message = ""
+                var messageColor = UIColor.label
+
+                if let errorMessage = textCheck?.error.localizedDescription {
+                    message = errorMessage
+                    messageColor = .red
+                } else if isFileHidden {
+                    message = NSLocalizedString("hidden_file_name_warning", comment: "")
+                }
+
+                let attributedString = NSAttributedString(string: message, attributes: [
+                    NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14),
+                    NSAttributedString.Key.foregroundColor: messageColor
+                ])
+
+                alertController.setValue(attributedString, forKey: "attributedMessage")
             }
 
         alertController.addAction(cancelAction)
@@ -146,8 +179,8 @@ extension UIAlertController {
         return alertController
     }
 
-    static func renameFile(fileName: String, account: String, completion: @escaping (_ newFileName: String) -> Void) -> UIAlertController {
-        let alertController = UIAlertController(title: NSLocalizedString("_rename_", comment: ""), message: nil, preferredStyle: .alert)
+    static func renameFile(fileName: String, isDirectory: Bool = false, account: String, completion: @escaping (_ newFileName: String) -> Void) -> UIAlertController {
+        let alertController = UIAlertController(title: NSLocalizedString(isDirectory ? "_rename_folder_" : "_rename_file_", comment: ""), message: nil, preferredStyle: .alert)
 
         let okAction = UIAlertAction(title: NSLocalizedString("_save_", comment: ""), style: .default, handler: { _ in
             guard let newFileName = alertController.textFields?.first?.text else { return }
@@ -164,6 +197,19 @@ extension UIAlertController {
             textField.autocapitalizationType = .words
         }
 
+        let oldExtension = fileName.fileExtension
+
+        let text = alertController.textFields?.first?.text ?? ""
+        let textCheck = FileNameValidator.shared.checkFileName(text, account: account)
+        var message = textCheck?.error.localizedDescription ?? ""
+        var messageColor = UIColor.red
+
+        let attributedString = NSAttributedString(string: message, attributes: [
+            NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14),
+            NSAttributedString.Key.foregroundColor: messageColor
+        ])
+        alertController.setValue(attributedString, forKey: "attributedMessage")
+
         // only allow saving if folder name exists
         NotificationCenter.default.addObserver(
             forName: UITextField.textDidBeginEditingNotification,
@@ -182,10 +228,31 @@ extension UIAlertController {
             object: alertController.textFields?.first,
             queue: .main) { _ in
                 guard let text = alertController.textFields?.first?.text else { return }
+                let newExtension = text.fileExtension
 
                 let textCheck = FileNameValidator.shared.checkFileName(text, account: account)
-                okAction.isEnabled = textCheck?.error == nil && !text.isEmpty
-                alertController.message = textCheck?.error.localizedDescription
+                let isFileHidden = FileNameValidator.shared.isFileHidden(text)
+
+                okAction.isEnabled = !text.isEmpty && textCheck?.error == nil
+
+                message = ""
+                messageColor = UIColor.label
+
+                if let errorMessage = textCheck?.error.localizedDescription {
+                    message = errorMessage
+                    messageColor = .red
+                } else if isFileHidden {
+                    message = NSLocalizedString("hidden_file_name_warning", comment: "")
+                } else if newExtension != oldExtension {
+                    message = NSLocalizedString("_file_name_new_extension_", comment: "")
+                }
+
+
+                let attributedString = NSAttributedString(string: message, attributes: [
+                    NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14),
+                    NSAttributedString.Key.foregroundColor: messageColor
+                ])
+                alertController.setValue(attributedString, forKey: "attributedMessage")
             }
 
         alertController.addAction(cancelAction)
@@ -193,12 +260,8 @@ extension UIAlertController {
         return alertController
     }
 
-    static func renameFile(metadata: tableMetadata) -> UIAlertController {
-        let alertController = UIAlertController(title: NSLocalizedString("_rename_", comment: ""), message: nil, preferredStyle: .alert)
-
-        let okAction = UIAlertAction(title: NSLocalizedString("_save_", comment: ""), style: .default, handler: { _ in
-            guard let fileNameNew = alertController.textFields?.first?.text else { return }
-
+    static func renameFile(metadata: tableMetadata, completion: @escaping (_ newFileName: String) -> Void = { _ in }) -> UIAlertController {
+        renameFile(fileName: metadata.fileNameView, isDirectory: metadata.isDirectory, account: metadata.account) { fileNameNew in
             // verify if already exists
             if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileName == %@", metadata.account, metadata.serverUrl, fileNameNew)) != nil {
                 NCContentPresenter().showError(error: NKError(errorCode: 0, errorDescription: "_rename_already_exists_"))
@@ -208,50 +271,15 @@ extension UIAlertController {
             NCNetworking.shared.renameMetadata(metadata, fileNameNew: fileNameNew)
 
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource, userInfo: ["serverUrl": metadata.serverUrl])
-        })
-
-        // text field is initially empty, no action
-        okAction.isEnabled = false
-        let cancelAction = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel)
 
-        alertController.addTextField { textField in
-            textField.text = metadata.fileNameView
-            textField.autocapitalizationType = .words
+            completion(fileNameNew)
         }
-
-        // only allow saving if folder name exists
-        NotificationCenter.default.addObserver(
-            forName: UITextField.textDidBeginEditingNotification,
-            object: alertController.textFields?.first,
-            queue: .main) { _ in
-                guard let textField = alertController.textFields?.first else { return }
-
-                if let start = textField.position(from: textField.beginningOfDocument, offset: 0),
-                   let end = textField.position(from: start, offset: textField.text?.withRemovedFileExtension.count ?? 0) {
-                    textField.selectedTextRange = textField.textRange(from: start, to: end)
-                }
-            }
-
-        NotificationCenter.default.addObserver(
-            forName: UITextField.textDidChangeNotification,
-            object: alertController.textFields?.first,
-            queue: .main) { _ in
-                guard let text = alertController.textFields?.first?.text else { return }
-
-                let textCheck = FileNameValidator.shared.checkFileName(text, account: NCManageDatabase.shared.getActiveTableAccount()?.account)
-                okAction.isEnabled = textCheck?.error == nil && !text.isEmpty
-                alertController.message = textCheck?.error.localizedDescription
-            }
-
-        alertController.addAction(cancelAction)
-        alertController.addAction(okAction)
-        return alertController
     }
 
-    static func warning(title: String? = nil, message: String? = nil) -> UIAlertController {
+    static func warning(title: String? = nil, message: String? = nil, completion: @escaping () -> Void = {}) -> UIAlertController {
         let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
 
-        let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default)
+        let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { _ in completion() }
 
         alertController.addAction(okAction)
 

+ 7 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon+MediaLayout.swift

@@ -74,9 +74,14 @@ extension NCCollectionViewCommon: NCMediaLayoutDelegate {
 
             if metadata.imageSize != CGSize.zero {
                 return metadata.imageSize
-            } else {
-                return CGSize(width: collectionView.frame.width / CGFloat(columnCount), height: collectionView.frame.width / CGFloat(columnCount))
+            } else if metadata.classFile == NKCommon.TypeClassFile.document.rawValue {
+                let ext = NCGlobal.shared.getSizeExtension(column: self.numberOfColumns)
+                if let image = self.utility.getImage(ocId: metadata.ocId, etag: metadata.etag, ext: ext) {
+                    return image.size
+                }
             }
+
+            return CGSize(width: collectionView.frame.width / CGFloat(columnCount), height: collectionView.frame.width / CGFloat(columnCount))
         }
     }
 }

+ 2 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon+SelectTabBar.swift

@@ -33,7 +33,7 @@ extension NCCollectionViewCommon: NCCollectionViewCommonSelectTabBarDelegate {
             fileSelect = self.dataSource.getMetadatas().compactMap({ $0.ocId })
         }
         tabBarSelect.update(fileSelect: fileSelect, metadatas: getSelectedMetadatas(), userId: session.userId)
-        self.reloadDataSource()
+        self.collectionView.reloadData()
     }
 
     func delete() {
@@ -135,6 +135,6 @@ extension NCCollectionViewCommon: NCCollectionViewCommonSelectTabBarDelegate {
         navigationController?.interactivePopGestureRecognizer?.isEnabled = !editMode
         navigationItem.hidesBackButton = editMode
         searchController(enabled: !editMode)
-        self.reloadDataSource()
+        self.collectionView.reloadData()
     }
 }

+ 33 - 2
iOSClient/Main/NCDragDrop.swift

@@ -88,6 +88,30 @@ class NCDragDrop: NSObject {
             }
         }
 
+        var invalidNameIndexes: [Int] = []
+        let session = NCSession.shared.getSession(controller: controller)
+
+        for (index, metadata) in metadatas.enumerated() {
+            if let fileNameError = FileNameValidator.shared.checkFileName(metadata.fileName, account: session.account) {
+                if metadatas.count == 1 {
+                    let alert = UIAlertController.renameFile(metadata: metadata) { newFileName in
+                        metadatas[index].fileName = newFileName
+                        metadatas[index].fileNameView = newFileName
+                    }
+
+                    controller?.present(alert, animated: true)
+                    return nil
+                } else {
+                    controller?.present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))"), animated: true)
+                    invalidNameIndexes.append(index)
+                }
+            }
+        }
+
+        for index in invalidNameIndexes.reversed() {
+            metadatas.remove(at: index)
+        }
+
         if metadatas.isEmpty {
             return nil
         } else {
@@ -101,8 +125,15 @@ class NCDragDrop: NSObject {
             Task {
                 let ocId = NSUUID().uuidString
                 let session = NCSession.shared.getSession(controller: controller)
-                let fileName = await NCNetworking.shared.createFileName(fileNameBase: url.lastPathComponent, account: session.account, serverUrl: serverUrl)
-                let fileNamePath = utilityFileSystem.getDirectoryProviderStorageOcId(ocId, fileNameView: fileName)
+                let newFileName = FileAutoRenamer.shared.rename(url.lastPathComponent, account: session.account)
+                let fileNamePath = utilityFileSystem.getDirectoryProviderStorageOcId(ocId, fileNameView: newFileName)
+
+                if let fileNameError = FileNameValidator.shared.checkFileName(newFileName, account: session.account) {
+                    await controller?.present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))"), animated: true)
+                    return
+                }
+
+                let fileName = await NCNetworking.shared.createFileName(fileNameBase: newFileName, account: session.account, serverUrl: serverUrl)
 
                 try data.write(to: URL(fileURLWithPath: fileNamePath))
 

+ 34 - 13
iOSClient/Main/NCPickerViewController.swift

@@ -135,9 +135,9 @@ class NCDocumentPickerViewController: NSObject, UIDocumentPickerDelegate {
     func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
         let session = NCSession.shared.getSession(controller: self.controller)
         if isViewerMedia,
-            let urlIn = urls.first,
-            let url = self.copySecurityScopedResource(url: urlIn, urlOut: FileManager.default.temporaryDirectory.appendingPathComponent(urlIn.lastPathComponent)),
-            let viewController = self.viewController {
+           let urlIn = urls.first,
+           let url = self.copySecurityScopedResource(url: urlIn, urlOut: FileManager.default.temporaryDirectory.appendingPathComponent(urlIn.lastPathComponent)),
+           let viewController = self.viewController {
             let ocId = NSUUID().uuidString
             let fileName = url.lastPathComponent
             let metadata = database.createMetadata(fileName: fileName,
@@ -154,7 +154,7 @@ class NCDocumentPickerViewController: NSObject, UIDocumentPickerDelegate {
             }
 
             if let fileNameError = FileNameValidator.shared.checkFileName(metadata.fileNameView, account: self.controller.account) {
-                controller.present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))"), animated: true)
+                self.controller.present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))"), animated: true)
             } else {
                 database.addMetadata(metadata)
                 NCViewer().view(viewController: viewController, metadata: metadata)
@@ -167,15 +167,16 @@ class NCDocumentPickerViewController: NSObject, UIDocumentPickerDelegate {
 
             for urlIn in urls {
                 let ocId = NSUUID().uuidString
-
                 let fileName = urlIn.lastPathComponent
-                let toPath = utilityFileSystem.getDirectoryProviderStorageOcId(ocId, fileNameView: fileName)
+                let newFileName = FileAutoRenamer.shared.rename(fileName, account: session.account)
+
+                let toPath = utilityFileSystem.getDirectoryProviderStorageOcId(ocId, fileNameView: newFileName)
                 let urlOut = URL(fileURLWithPath: toPath)
 
                 guard self.copySecurityScopedResource(url: urlIn, urlOut: urlOut) != nil else { continue }
 
-                let metadataForUpload = database.createMetadata(fileName: fileName,
-                                                                fileNameView: fileName,
+                let metadataForUpload = database.createMetadata(fileName: newFileName,
+                                                                fileNameView: newFileName,
                                                                 ocId: ocId,
                                                                 serverUrl: serverUrl,
                                                                 url: "",
@@ -183,11 +184,6 @@ class NCDocumentPickerViewController: NSObject, UIDocumentPickerDelegate {
                                                                 session: session,
                                                                 sceneIdentifier: self.controller.sceneIdentifier)
 
-                if let fileNameError = FileNameValidator.shared.checkFileName(metadataForUpload.fileNameView, account: self.controller.account) {
-                    controller.present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))"), animated: true)
-                    continue
-                }
-
                 metadataForUpload.session = NCNetworking.shared.sessionUploadBackground
                 metadataForUpload.sessionSelector = NCGlobal.shared.selectorUploadFile
                 metadataForUpload.size = utilityFileSystem.getFileSize(filePath: toPath)
@@ -201,6 +197,31 @@ class NCDocumentPickerViewController: NSObject, UIDocumentPickerDelegate {
                 }
             }
 
+            var invalidNameIndexes: [Int] = []
+
+            for (index, metadata) in metadatas.enumerated() {
+                if let fileNameError = FileNameValidator.shared.checkFileName(metadata.fileName, account: session.account) {
+                    if metadatas.count == 1 {
+                        let alert = UIAlertController.renameFile(fileName: metadata.fileName, account: session.account) { newFileName in
+                            metadatas[index].fileName = newFileName
+                            metadatas[index].fileNameView = newFileName
+
+                            NCNetworkingProcess.shared.createProcessUploads(metadatas: metadatas)
+                        }
+
+                        self.controller.present(alert, animated: true)
+                        return
+                    } else {
+                        self.controller.present(UIAlertController.warning(message: "\(fileNameError.errorDescription) \(NSLocalizedString("_please_rename_file_", comment: ""))"), animated: true)
+                        invalidNameIndexes.append(index)
+                    }
+                }
+            }
+
+            for index in invalidNameIndexes.reversed() {
+                metadatas.remove(at: index)
+            }
+
             NCNetworkingProcess.shared.createProcessUploads(metadatas: metadatas)
 
             if !metadatasInConflict.isEmpty {

+ 1 - 0
iOSClient/NCGlobal.swift

@@ -281,6 +281,7 @@ class NCGlobal: NSObject {
     let metadataStatusInTransfer                = [-1, -2, 1, 2]
     let metadataStatusFileDown                  = [-1, -2, -3]
     let metadataStatusHideInView                = [1, 2, 3, 11]
+    let metadataStatusHideInFileExtension       = [1, 2, 3, 10, 11]
     let metadataStatusObserve                   = [-1, 1, 10, 11, 12, 13, 14, 15]
     let metadataStatusWaitWebDav                = [10, 11, 12, 13, 14, 15]
 

+ 0 - 1
iOSClient/Scan document/NCUploadScanDocument.swift

@@ -382,7 +382,6 @@ struct UploadScanDocumentView: View {
                                         footer = fileNameError.errorDescription
                                     } else {
                                         footer = ""
-
                                     }
                                 }
                         }

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


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


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


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


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


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


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


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


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


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


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


BIN
iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings


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


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


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


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


BIN
iOSClient/Supporting Files/en-GB.lproj/Localizable.strings


+ 3 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -1123,4 +1123,6 @@
 "_file_name_validator_error_forbidden_file_extension_" = "\".%@\" is a forbidden file extension.";
 "_file_name_validator_error_invalid_character_" = "Name contains an invalid character: \"%@\".";
 "_file_name_validator_error_space_" = "Name must not contain spaces at the beginning or end.";
-"_please_rename_file_"      = "Please rename the file or folder.";
+"_file_name_new_extension_" = "Changing the extension might cause this file to open in a different application.";
+"_please_rename_file_" = "Please rename the file or folder.";
+"hidden_file_name_warning" = "Name will result in a hidden file.";

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


BIN
iOSClient/Supporting Files/fi-FI.lproj/Localizable.strings


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


BIN
iOSClient/Supporting Files/ja-JP.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/ka-GE.lproj/Localizable.strings


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


BIN
iOSClient/Supporting Files/nb-NO.lproj/Localizable.strings


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


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


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


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


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


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


BIN
iOSClient/Supporting Files/pt-BR.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/pt-PT.lproj/Localizable.strings


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


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


Some files were not shown because too many files changed in this diff