diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-14 17:35:59 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-14 17:35:59 +0200 |
commit | 1550af87cd341dfd81c8338b82464123e5cb0510 (patch) | |
tree | 78ff8e84031053ab3352c1483f8e373297da1459 /apps/files/lib/Controller/TransferOwnershipController.php | |
parent | 54bf26ae50138606085cdaec50a8443bdf0b7b50 (diff) | |
download | nextcloud-server-1550af87cd341dfd81c8338b82464123e5cb0510.tar.gz nextcloud-server-1550af87cd341dfd81c8338b82464123e5cb0510.zip |
fix(files): Properly handle denied ownership transfers
When the receiver denies the transfer the notification handler was missing,
so no notification was created for the transfer owner.
But also the internal notification was created two times:
1. When rejecting the transfer
2. By the reject function when dismissing the notification
This is fixed by only relying on the dismiss function.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/lib/Controller/TransferOwnershipController.php')
-rw-r--r-- | apps/files/lib/Controller/TransferOwnershipController.php | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/apps/files/lib/Controller/TransferOwnershipController.php b/apps/files/lib/Controller/TransferOwnershipController.php index e5bce7946e3..924c200f375 100644 --- a/apps/files/lib/Controller/TransferOwnershipController.php +++ b/apps/files/lib/Controller/TransferOwnershipController.php @@ -189,20 +189,10 @@ class TransferOwnershipController extends OCSController { ->setObject('transfer', (string)$id); $this->notificationManager->markProcessed($notification); - $notification = $this->notificationManager->createNotification(); - $notification->setUser($transferOwnership->getSourceUser()) - ->setApp($this->appName) - ->setDateTime($this->timeFactory->getDateTime()) - ->setSubject('transferownershipRequestDenied', [ - 'sourceUser' => $transferOwnership->getSourceUser(), - 'targetUser' => $transferOwnership->getTargetUser(), - 'nodeName' => $transferOwnership->getNodeName() - ]) - ->setObject('transfer', (string)$transferOwnership->getId()); - $this->notificationManager->notify($notification); - $this->mapper->delete($transferOwnership); + // A "request denied" notification will be created by Notifier::dismissNotification + return new DataResponse([], Http::STATUS_OK); } } |