ソースを参照

improved e2ee

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年 前
コミット
d8bb391371
1 ファイル変更2 行追加8 行削除
  1. 2 8
      iOSClient/Utility/NCUtility.swift

+ 2 - 8
iOSClient/Utility/NCUtility.swift

@@ -1006,15 +1006,9 @@ class NCUtility: NSObject {
     }
     @objc func isFolderEncrypted(serverUrl: String, e2eEncrypted: Bool = false, account:String, urlBase: String, userId: String) -> Bool {
         if e2eEncrypted { return true }
-        let home = NCUtilityFileSystem.shared.getHomeServer(urlBase: urlBase, userId: userId)
-        if serverUrl == home || serverUrl == ".." { return false }
-        // Current
+        if serverUrl == NCUtilityFileSystem.shared.getHomeServer(urlBase: urlBase, userId: userId) || serverUrl == ".." { return false }
         if let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl)) {
-            if directory.e2eEncrypted { return true }
-            // .. up one ..
-            if let serverUrl = NCUtilityFileSystem.shared.deleteLastPath(serverUrlPath: serverUrl, home: home), serverUrl != home, let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl))  {
-                return directory.e2eEncrypted
-            }
+            return directory.e2eEncrypted
         }
         return false
     }