瀏覽代碼

normalized

marinofaggiana 4 年之前
父節點
當前提交
e087266681

+ 1 - 1
Cartfile.resolved

@@ -18,7 +18,7 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.7.2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.7"
-github "nextcloud/ios-communication-library" "85662ef281591fcf781277a2cdb6dc4261004188"
+github "nextcloud/ios-communication-library" "84c142e195ce20190396fa12d867338ce4c911e7"
 github "realm/realm-cocoa" "v5.3.3"
 github "rechsteiner/Parchment" "v2.4.0"
 github "scenee/FloatingPanel" "v1.7.5"

+ 6 - 6
File Provider Extension/FileProviderData.swift

@@ -75,7 +75,7 @@ class fileProviderData: NSObject {
             
             guard let tableAccount = NCManageDatabase.sharedInstance.getAccountActive() else { return false }
             let serverVersionMajor = NCManageDatabase.sharedInstance.getCapabilitiesServerInt(account: tableAccount.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
-            let webDavRoot = NCManageDatabase.sharedInstance.getCapabilitiesServerString(account: tableAccount.account, elements: NCElementsJSON.shared.capabilitiesWebDavRoot)
+            let webDav = NCUtility.shared.getWebDAV(account: tableAccount.account)
             
             account = tableAccount.account
             accountUser = tableAccount.user
@@ -84,7 +84,7 @@ class fileProviderData: NSObject {
             accountUrlBase = tableAccount.urlBase
             homeServerUrl = NCUtility.shared.getHomeServer(urlBase: tableAccount.urlBase, account: tableAccount.account)
                         
-            NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: accountPassword, urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+            NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: accountPassword, urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
             NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
             
             return true
@@ -100,7 +100,7 @@ class fileProviderData: NSObject {
             if accountDomain == domain {
                 
                 let serverVersionMajor = NCManageDatabase.sharedInstance.getCapabilitiesServerInt(account: tableAccount.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
-                let webDavRoot = NCManageDatabase.sharedInstance.getCapabilitiesServerString(account: tableAccount.account, elements: NCElementsJSON.shared.capabilitiesWebDavRoot)
+                let webDav = NCUtility.shared.getWebDAV(account: tableAccount.account)
                 
                 account = tableAccount.account
                 accountUser = tableAccount.user
@@ -110,7 +110,7 @@ class fileProviderData: NSObject {
                 accountUrlBase = tableAccount.urlBase
                 homeServerUrl = NCUtility.shared.getHomeServer(urlBase: tableAccount.urlBase, account: tableAccount.account)
                 
-                NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: accountPassword, urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+                NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: accountPassword, urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
                 NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
 
                 foundAccount = true
@@ -133,7 +133,7 @@ class fileProviderData: NSObject {
             if accountFromItemIdentifier == tableAccount.account {
                 
                 let serverVersionMajor = NCManageDatabase.sharedInstance.getCapabilitiesServerInt(account: tableAccount.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
-                let webDavRoot = NCManageDatabase.sharedInstance.getCapabilitiesServerString(account: tableAccount.account, elements: NCElementsJSON.shared.capabilitiesWebDavRoot)
+                let webDav = NCUtility.shared.getWebDAV(account: tableAccount.account)
                 
                 account = tableAccount.account
                 accountUser = tableAccount.user
@@ -142,7 +142,7 @@ class fileProviderData: NSObject {
                 accountUrlBase = tableAccount.urlBase
                 homeServerUrl = NCUtility.shared.getHomeServer(urlBase: tableAccount.urlBase, account: tableAccount.account)
                 
-                NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: accountPassword, urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+                NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: accountPassword, urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
                 NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
                 
                 foundAccount = true

+ 2 - 2
Share/ShareViewController.m

@@ -62,10 +62,10 @@
     } else {
         
         NSInteger serverVersionMajor = [[NCManageDatabase sharedInstance] getCapabilitiesServerIntWithAccount:tableAccount.account elements:NCElementsJSON.shared.capabilitiesVersionMajor];
-        NSString *webDavRoot = [[NCManageDatabase sharedInstance] getCapabilitiesServerStringWithAccount:tableAccount.account elements:NCElementsJSON.shared.capabilitiesWebDavRoot];
+        NSString *webDav = [[NCUtility shared] getWebDAVWithAccount:tableAccount.account];
         
         // Networking
-        [[NCCommunicationCommon shared] setupWithAccount:tableAccount.account user:tableAccount.user userId:tableAccount.userID password:[CCUtility getPassword:tableAccount.account] urlBase:tableAccount.urlBase userAgent:[CCUtility getUserAgent] capabilitiesGroup:[NCBrandOptions sharedInstance].capabilitiesGroups webDavRoot:webDavRoot davRoot:nil nextcloudVersion:serverVersionMajor delegate:[NCNetworking shared]];
+        [[NCCommunicationCommon shared] setupWithAccount:tableAccount.account user:tableAccount.user userId:tableAccount.userID password:[CCUtility getPassword:tableAccount.account] urlBase:tableAccount.urlBase userAgent:[CCUtility getUserAgent] capabilitiesGroup:[NCBrandOptions sharedInstance].capabilitiesGroups webDav:webDav dav:nil nextcloudVersion:serverVersionMajor delegate:[NCNetworking shared]];
        
         _account = tableAccount.account;
         _urlBase = tableAccount.urlBase;

+ 1 - 1
iOSClient/AppDelegate.h

@@ -121,7 +121,7 @@
 // Setting Account & Communication
 - (void)settingAccount:(NSString *)account urlBase:(NSString *)urlBase user:(NSString *)user userID:(NSString *)userID password:(NSString *)password;
 - (void)deleteAccount:(NSString *)account wipe:(BOOL)wipe;
-- (void)settingSetupCommunicationCapabilities:(NSString *)account;
+- (void)settingSetupCommunication:(NSString *)account;
 
 // Quick Actions - ShotcutItem
 - (void)configDynamicShortcutItems;

+ 4 - 6
iOSClient/AppDelegate.m

@@ -401,7 +401,7 @@
     (void)[NCNetworkingNotificationCenter shared];
 
     [[NCCommunicationCommon shared] setupWithAccount:account user:user userId:userID password:password urlBase:urlBase];
-    [self settingSetupCommunicationCapabilities:account];
+    [self settingSetupCommunication:account];
 }
 
 - (void)deleteAccount:(NSString *)account wipe:(BOOL)wipe
@@ -438,17 +438,15 @@
     }
 }
 
-- (void)settingSetupCommunicationCapabilities:(NSString *)account
+- (void)settingSetupCommunication:(NSString *)account
 {
     NSInteger serverVersionMajor = [[NCManageDatabase sharedInstance] getCapabilitiesServerIntWithAccount:account elements:NCElementsJSON.shared.capabilitiesVersionMajor];
     if (serverVersionMajor > 0) {
         [[NCCommunicationCommon shared] setupWithNextcloudVersion:serverVersionMajor];
      }
     
-    NSString *webDavRoot = [[NCManageDatabase sharedInstance] getCapabilitiesServerStringWithAccount:account elements:NCElementsJSON.shared.capabilitiesWebDavRoot];
-    if (webDavRoot != nil) {
-        [[NCCommunicationCommon shared] setupWithWebDavRoot:webDavRoot];
-    }
+    [[NCCommunicationCommon shared] setupWithWebDav:[[NCUtility shared] getWebDAVWithAccount:account]];
+    [[NCCommunicationCommon shared] setupWithDav:[[NCUtility shared] getDAV]];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -148,7 +148,7 @@ class NCService: NSObject {
                 NCManageDatabase.sharedInstance.addCapabilitiesJSon(data!, account: account)
             
                 // Setup communication
-                self.appDelegate.settingSetupCommunicationCapabilities(account)
+                self.appDelegate.settingSetupCommunication(account)
             
                 // Theming
                 self.appDelegate.settingThemingColorBrand()