diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-03 15:21:04 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-03 15:21:04 +0200 |
commit | 22f6960f8397c3f6a60b04097ad77b281ad033f4 (patch) | |
tree | 79b9abb30f0239196a554c0aa12cf39245c662f8 /apps/federatedfilesharing | |
parent | ecfa6f7e0c23d20dc2093a9f832c7ef4dd309a11 (diff) | |
download | nextcloud-server-22f6960f8397c3f6a60b04097ad77b281ad033f4.tar.gz nextcloud-server-22f6960f8397c3f6a60b04097ad77b281ad033f4.zip |
Allow removing federated shares of locally reshared files
* UserA shares a folder to UserB
* UserB does a federated share to userC@serverC
* UserB now tries to revoke the federated share
Before we always tried to notify the remote cloud. The case that the
file was reshared locally was not considered. This patch makes sure not
to try to notify a federated server if both users are local users.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r-- | apps/federatedfilesharing/lib/FederatedShareProvider.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index f0ec9e3cb68..67089cba9d3 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -563,6 +563,11 @@ class FederatedShareProvider implements IShareProvider { * @throws \OC\HintException */ protected function revokeShare($share, $isOwner) { + if ($this->userManager->userExists($share->getShareOwner() && $this->userManager->userExists($share->getSharedBy()))) { + // If both the owner and the initiator of the share are local users we don't have to notify anybody else + return; + } + // also send a unShare request to the initiator, if this is a different user than the owner if ($share->getShareOwner() !== $share->getSharedBy()) { if ($isOwner) { |