- 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>
This commit is contained in:
parent
a176a1f318
commit
d77eedd23b
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue