Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-06-29 19:02:12 +0300
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-11 11:11:47 +0300
commit1d5a9c3f979b23bac98243ba2245a21bdff722c8 (patch)
tree4f28b0c42618271c0955117f3c96770cdf47817d /apps/federatedfilesharing
parent7d2add622e1948f85e0c2abe4fc5a71123b7bcde (diff)
handle unshare request from owner
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php43
1 files changed, 25 insertions, 18 deletions
diff --git a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php
index 1f46c6b677d..1d922ce60ba 100644
--- a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php
+++ b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php
@@ -578,25 +578,32 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
$qb->execute();
- if ($share['accepted']) {
- $path = trim($mountpoint, '/');
- } else {
- $path = trim($share['name'], '/');
- }
+ // delete all child in case of a group share
+ $qb = $this->connection->getQueryBuilder();
+ $qb->delete('share_external')
+ ->where($qb->expr()->eq('parent', $qb->createNamedParameter((int)$share['id'])));
+ $qb->execute();
- $notification = $this->notificationManager->createNotification();
- $notification->setApp('files_sharing')
- ->setUser($share['user'])
- ->setObject('remote_share', (int)$share['id']);
- $this->notificationManager->markProcessed($notification);
-
- $event = $this->activityManager->generateEvent();
- $event->setApp('files_sharing')
- ->setType('remote_share')
- ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path])
- ->setAffectedUser($user)
- ->setObject('remote_share', (int)$share['id'], $path);
- \OC::$server->getActivityManager()->publish($event);
+ if ((int)$share['share_type'] === Share::SHARE_TYPE_USER) {
+ if ($share['accepted']) {
+ $path = trim($mountpoint, '/');
+ } else {
+ $path = trim($share['name'], '/');
+ }
+ $notification = $this->notificationManager->createNotification();
+ $notification->setApp('files_sharing')
+ ->setUser($share['user'])
+ ->setObject('remote_share', (int)$share['id']);
+ $this->notificationManager->markProcessed($notification);
+
+ $event = $this->activityManager->generateEvent();
+ $event->setApp('files_sharing')
+ ->setType('remote_share')
+ ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path])
+ ->setAffectedUser($user)
+ ->setObject('remote_share', (int)$share['id'], $path);
+ \OC::$server->getActivityManager()->publish($event);
+ }
}
return [];