From 449011dae7ea0ec7eb8d6c78e89709982020e709 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 10 Mar 2017 15:37:21 +0100 Subject: remove discovery manager in favour of the OCSDiscoveryService Signed-off-by: Bjoern Schiessle --- lib/private/Share/Share.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/private/Share/Share.php') 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://'; -- cgit v1.2.3