summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-03-14 15:12:16 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-03-17 08:41:34 +0100
commit5c9baf4ae2ce484eb3d6c80195809aa832eca5df (patch)
tree71526303003e49ab30679a0fce4e2d6d500d2905 /lib
parent9915aa6d9c5f5cf4ebac0b6bc0df0c16ca215c70 (diff)
downloadnextcloud-server-5c9baf4ae2ce484eb3d6c80195809aa832eca5df.tar.gz
nextcloud-server-5c9baf4ae2ce484eb3d6c80195809aa832eca5df.zip
Add unshare event
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index acc142f62be..d257b64bee9 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -803,6 +803,9 @@ class Manager implements IManager {
throw new \InvalidArgumentException('Share does not have a full id');
}
+ $event = new GenericEvent($share);
+ $this->eventDispatcher->dispatch('OCP\Share::preUnshare', $event);
+
$formatHookParams = function(\OCP\Share\IShare $share) {
// Prepare hook
$shareType = $share->getShareType();
@@ -852,6 +855,8 @@ class Manager implements IManager {
$hookParams['deletedShares'] = $formattedDeletedShares;
// Emit post hook
+ $event->setArgument('deletedShares', $deletedShares);
+ $this->eventDispatcher->dispatch('OCP\Share::postUnshare', $event);
\OC_Hook::emit('OCP\Share', 'post_unshare', $hookParams);
}