summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Share/Share.php8
-rw-r--r--lib/private/Share20/ProviderFactory.php6
2 files changed, 4 insertions, 10 deletions
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 924e2f68396..2b4a57b89a4 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -2742,12 +2742,10 @@ class Share extends Constants {
'result' => '',
];
$try = 0;
- $discoveryManager = new DiscoveryManager(
- \OC::$server->getMemCacheFactory(),
- \OC::$server->getHTTPClientService()
- );
+ $discoveryService = \OC::$server->getOCSDiscoveryService();
while ($result['success'] === false && $try < 2) {
- $endpoint = $discoveryManager->getShareEndpoint($protocol . $remoteDomain);
+ $federationEndpoints = $discoveryService->discover($protocol . $remoteDomain, 'FEDERATED_SHARING');
+ $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares';
$result = \OC::$server->getHTTPHelper()->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, $fields);
$try++;
$protocol = 'http://';
diff --git a/lib/private/Share20/ProviderFactory.php b/lib/private/Share20/ProviderFactory.php
index b411f42b262..5eb34a483e7 100644
--- a/lib/private/Share20/ProviderFactory.php
+++ b/lib/private/Share20/ProviderFactory.php
@@ -104,14 +104,10 @@ class ProviderFactory implements IProviderFactory {
$l,
$this->serverContainer->getCloudIdManager()
);
- $discoveryManager = new DiscoveryManager(
- $this->serverContainer->getMemCacheFactory(),
- $this->serverContainer->getHTTPClientService()
- );
$notifications = new Notifications(
$addressHandler,
$this->serverContainer->getHTTPClientService(),
- $discoveryManager,
+ $this->serverContainer->getOCSDiscoveryService(),
$this->serverContainer->getJobList()
);
$tokenHandler = new TokenHandler(