summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-06-05 17:19:42 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-02 11:29:29 +0200
commitd77eedd23bac7f9d28a5d478263914c34b8003c4 (patch)
tree7e166f999c3d4d2f810ec0ba206fb1a4bb0c5b4f /apps
parenta176a1f318501ecf344a43b66811985eee99c426 (diff)
downloadnextcloud-server-d77eedd23bac7f9d28a5d478263914c34b8003c4.tar.gz
nextcloud-server-d77eedd23bac7f9d28a5d478263914c34b8003c4.zip
- Don't remove share before all notifications are created, otherwise we miss information necessary to create the notifications
- Don't send message to owner/sharer about revoked re-shares twice. Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php16
1 files changed, 3 insertions, 13 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 62be96dfa00..370ba44a0bd 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -514,29 +514,19 @@ class FederatedShareProvider implements IShareProvider {
$isOwner = false;
- $this->removeShareFromTable($share);
-
// if the local user is the owner we can send the unShare request directly...
if ($this->userManager->userExists($share->getShareOwner())) {
$this->notifications->sendRemoteUnShare($remote, $share->getId(), $share->getToken());
$this->revokeShare($share, true);
- $isOwner = true;
} else { // ... if not we need to correct ID for the unShare request
$remoteId = $this->getRemoteId($share);
$this->notifications->sendRemoteUnShare($remote, $remoteId, $share->getToken());
$this->revokeShare($share, false);
}
- // send revoke notification to the other user, if initiator and owner are not the same user
- if ($share->getShareOwner() !== $share->getSharedBy()) {
- $remoteId = $this->getRemoteId($share);
- if ($isOwner) {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
- } else {
- list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
- }
- $this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken());
- }
+ // only remove the share when all messages are send to not lose information
+ // about the share to early
+ $this->removeShareFromTable($share);
}
/**