aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/api
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-01 11:27:28 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-01 11:27:28 +0100
commit5fe5233f419624dc3eac8ee4bf95a38b001ea6fd (patch)
tree4c0b5ea576ec67cc2d5f57ccb186e65276d1cc3c /apps/files_sharing/api
parent73e145cf63e94f68dc1f129da14e470695d46abd (diff)
parent88fc5149eddcbeaf41358c0eb56be45ad2c94a59 (diff)
downloadnextcloud-server-5fe5233f419624dc3eac8ee4bf95a38b001ea6fd.tar.gz
nextcloud-server-5fe5233f419624dc3eac8ee4bf95a38b001ea6fd.zip
Merge pull request #22681 from owncloud/add-autodiscovery-for-ocs
Add autodiscovery support to server-to-server sharing implementation
Diffstat (limited to 'apps/files_sharing/api')
-rw-r--r--apps/files_sharing/api/remote.php31
-rw-r--r--apps/files_sharing/api/server2server.php6
2 files changed, 37 insertions, 0 deletions
diff --git a/apps/files_sharing/api/remote.php b/apps/files_sharing/api/remote.php
index 8b47955b51e..1b5eb28aa86 100644
--- a/apps/files_sharing/api/remote.php
+++ b/apps/files_sharing/api/remote.php
@@ -24,6 +24,7 @@
namespace OCA\Files_Sharing\API;
use OC\Files\Filesystem;
+use OCA\FederatedFileSharing\DiscoveryManager;
use OCA\Files_Sharing\External\Manager;
class Remote {
@@ -35,12 +36,17 @@ class Remote {
* @return \OC_OCS_Result
*/
public static function getOpenShares($params) {
+ $discoveryManager = new DiscoveryManager(
+ \OC::$server->getMemCacheFactory(),
+ \OC::$server->getHTTPClientService()
+ );
$externalManager = new Manager(
\OC::$server->getDatabaseConnection(),
Filesystem::getMountManager(),
Filesystem::getLoader(),
\OC::$server->getHTTPHelper(),
\OC::$server->getNotificationManager(),
+ $discoveryManager,
\OC_User::getUser()
);
@@ -54,12 +60,17 @@ class Remote {
* @return \OC_OCS_Result
*/
public static function acceptShare($params) {
+ $discoveryManager = new DiscoveryManager(
+ \OC::$server->getMemCacheFactory(),
+ \OC::$server->getHTTPClientService()
+ );
$externalManager = new Manager(
\OC::$server->getDatabaseConnection(),
Filesystem::getMountManager(),
Filesystem::getLoader(),
\OC::$server->getHTTPHelper(),
\OC::$server->getNotificationManager(),
+ $discoveryManager,
\OC_User::getUser()
);
@@ -80,12 +91,17 @@ class Remote {
* @return \OC_OCS_Result
*/
public static function declineShare($params) {
+ $discoveryManager = new DiscoveryManager(
+ \OC::$server->getMemCacheFactory(),
+ \OC::$server->getHTTPClientService()
+ );
$externalManager = new Manager(
\OC::$server->getDatabaseConnection(),
Filesystem::getMountManager(),
Filesystem::getLoader(),
\OC::$server->getHTTPHelper(),
\OC::$server->getNotificationManager(),
+ $discoveryManager,
\OC_User::getUser()
);
@@ -123,12 +139,17 @@ class Remote {
* @return \OC_OCS_Result
*/
public static function getShares($params) {
+ $discoveryManager = new DiscoveryManager(
+ \OC::$server->getMemCacheFactory(),
+ \OC::$server->getHTTPClientService()
+ );
$externalManager = new Manager(
\OC::$server->getDatabaseConnection(),
Filesystem::getMountManager(),
Filesystem::getLoader(),
\OC::$server->getHTTPHelper(),
\OC::$server->getNotificationManager(),
+ $discoveryManager,
\OC_User::getUser()
);
@@ -146,12 +167,17 @@ class Remote {
* @return \OC_OCS_Result
*/
public static function getShare($params) {
+ $discoveryManager = new DiscoveryManager(
+ \OC::$server->getMemCacheFactory(),
+ \OC::$server->getHTTPClientService()
+ );
$externalManager = new Manager(
\OC::$server->getDatabaseConnection(),
Filesystem::getMountManager(),
Filesystem::getLoader(),
\OC::$server->getHTTPHelper(),
\OC::$server->getNotificationManager(),
+ $discoveryManager,
\OC_User::getUser()
);
@@ -172,12 +198,17 @@ class Remote {
* @return \OC_OCS_Result
*/
public static function unshare($params) {
+ $discoveryManager = new DiscoveryManager(
+ \OC::$server->getMemCacheFactory(),
+ \OC::$server->getHTTPClientService()
+ );
$externalManager = new Manager(
\OC::$server->getDatabaseConnection(),
Filesystem::getMountManager(),
Filesystem::getLoader(),
\OC::$server->getHTTPHelper(),
\OC::$server->getNotificationManager(),
+ $discoveryManager,
\OC_User::getUser()
);
diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php
index f04ddc81b84..6da95ed6549 100644
--- a/apps/files_sharing/api/server2server.php
+++ b/apps/files_sharing/api/server2server.php
@@ -25,6 +25,7 @@
namespace OCA\Files_Sharing\API;
+use OCA\FederatedFileSharing\DiscoveryManager;
use OCA\Files_Sharing\Activity;
use OCP\Files\NotFoundException;
@@ -70,12 +71,17 @@ class Server2Server {
\OC_Util::setupFS($shareWith);
+ $discoveryManager = new DiscoveryManager(
+ \OC::$server->getMemCacheFactory(),
+ \OC::$server->getHTTPClientService()
+ );
$externalManager = new \OCA\Files_Sharing\External\Manager(
\OC::$server->getDatabaseConnection(),
\OC\Files\Filesystem::getMountManager(),
\OC\Files\Filesystem::getLoader(),
\OC::$server->getHTTPHelper(),
\OC::$server->getNotificationManager(),
+ $discoveryManager,
$shareWith
);