summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-06-04 12:16:03 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-02 11:29:28 +0200
commitfab4e561f4f3ea9a3cf90a01c39c8d1e87ee9eab (patch)
tree723753d2819808ab0ed16d7c9574a3fd6a74ab26 /lib
parent41a1528888062610af58e319ce7bfa3ef8784da3 (diff)
downloadnextcloud-server-fab4e561f4f3ea9a3cf90a01c39c8d1e87ee9eab.tar.gz
nextcloud-server-fab4e561f4f3ea9a3cf90a01c39c8d1e87ee9eab.zip
send reshare over OCM API
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Federation/CloudFederationProviderManager.php7
-rw-r--r--lib/public/Federation/ICloudFederationProvider.php1
-rw-r--r--lib/public/Federation/ICloudFederationProviderManager.php4
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/Federation/CloudFederationProviderManager.php b/lib/private/Federation/CloudFederationProviderManager.php
index 9aab1753a47..aa25ba9dee8 100644
--- a/lib/private/Federation/CloudFederationProviderManager.php
+++ b/lib/private/Federation/CloudFederationProviderManager.php
@@ -166,7 +166,7 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
/**
* @param string $url
* @param ICloudFederationNotification $notification
- * @return bool
+ * @return mixed
*/
public function sendNotification($url, ICloudFederationNotification $notification) {
$ocmEndPoint = $this->getOCMEndPoint($url);
@@ -182,8 +182,9 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
'timeout' => 10,
'connect_timeout' => 10,
]);
- if ($response->getStatusCode() === Http::STATUS_OK) {
- return true;
+ if ($response->getStatusCode() === Http::STATUS_CREATED) {
+ $result = json_decode($response->getBody(), true);
+ return (is_array($result)) ? $result : [];
}
} catch (\Exception $e) {
// log the error and return false
diff --git a/lib/public/Federation/ICloudFederationProvider.php b/lib/public/Federation/ICloudFederationProvider.php
index 36af413cdc2..5260cbf9aa3 100644
--- a/lib/public/Federation/ICloudFederationProvider.php
+++ b/lib/public/Federation/ICloudFederationProvider.php
@@ -66,6 +66,7 @@ interface ICloudFederationProvider {
* @param string $notificationType (e.g SHARE_ACCEPTED)
* @param string $providerId share ID
* @param array $notification provider specific notification
+ * @return array $data send back to sender
*
* @throws ShareNotFoundException
* @throws ActionNotSupportedException
diff --git a/lib/public/Federation/ICloudFederationProviderManager.php b/lib/public/Federation/ICloudFederationProviderManager.php
index 714c6234b71..7a14e49a7ba 100644
--- a/lib/public/Federation/ICloudFederationProviderManager.php
+++ b/lib/public/Federation/ICloudFederationProviderManager.php
@@ -77,7 +77,7 @@ interface ICloudFederationProviderManager {
* send federated share
*
* @param ICloudFederationShare $share
- * @return mixed
+ * @return bool
*
* @since 14.0.0
*/
@@ -88,7 +88,7 @@ interface ICloudFederationProviderManager {
*
* @param string $url
* @param ICloudFederationNotification $notification
- * @return bool
+ * @return mixed
*
* @since 14.0.0
*/