marinofaggiana 4 anni fa
parent
commit
5dacbd78e0

+ 11 - 13
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -45,6 +45,7 @@ extension AppDelegate {
         let appDelegate = UIApplication.shared.delegate as! AppDelegate
         let directEditingCreators = NCManageDatabase.sharedInstance.getDirectEditingCreators(account: appDelegate.activeAccount)
         let isEncrypted = CCUtility.isFolderEncrypted(appDelegate.activeMain.serverUrl, e2eEncrypted: false, account: appDelegate.activeAccount)
+        let serverVersionMajor = NCManageDatabase.sharedInstance.getCapabilitiesServerVersion(account: appDelegate.activeAccount, element: "major")
         
         actions.append(
             NCMenuAction(
@@ -130,21 +131,18 @@ extension AppDelegate {
             )
         )
 
-        
-        if let capabilities = NCManageDatabase.sharedInstance.getCapabilites(account: appDelegate.activeAccount) {
-            if (capabilities.versionMajor >= k_nextcloud_version_18_0 && (self.activeMain.richWorkspaceText == nil || self.activeMain.richWorkspaceText.count == 0)) && !isEncrypted {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_add_folder_info_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "addFolderInfo"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            self.activeMain.createRichWorkspace()
-                        }
-                    )
+        if (serverVersionMajor >= k_nextcloud_version_18_0 && (self.activeMain.richWorkspaceText == nil || self.activeMain.richWorkspaceText.count == 0)) && !isEncrypted {
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_add_folder_info_", comment: ""),
+                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "addFolderInfo"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                    action: { menuAction in
+                        self.activeMain.createRichWorkspace()
+                    }
                 )
-            }
+            )
         }
-        
+               
         if appDelegate.reachability.isReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_docx}) && !isEncrypted {
             let directEditingCreator = directEditingCreators!.first(where: { $0.editor == k_editor_onlyoffice && $0.identifier == k_onlyoffice_docx})!
             actions.append(

+ 3 - 3
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -44,9 +44,9 @@
     XLFormSectionDescriptor *section;
     XLFormRowDescriptor *row;
     
-    tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesWithAccount:appDelegate.activeAccount];
-
-    if (capabilities.endToEndEncryption == NO) {
+    BOOL isE2EEEnabled = [[NCManageDatabase sharedInstance] getCapabilitiesE2EEEnabledWithAccount:appDelegate.activeAccount];
+    
+    if (isE2EEEnabled == NO) {
         
         // Section SERVICE NOT AVAILABLE -------------------------------------------------