Add unshare event
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
9915aa6d9c
commit
5c9baf4ae2
|
@ -803,6 +803,9 @@ class Manager implements IManager {
|
||||||
throw new \InvalidArgumentException('Share does not have a full id');
|
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) {
|
$formatHookParams = function(\OCP\Share\IShare $share) {
|
||||||
// Prepare hook
|
// Prepare hook
|
||||||
$shareType = $share->getShareType();
|
$shareType = $share->getShareType();
|
||||||
|
@ -852,6 +855,8 @@ class Manager implements IManager {
|
||||||
$hookParams['deletedShares'] = $formattedDeletedShares;
|
$hookParams['deletedShares'] = $formattedDeletedShares;
|
||||||
|
|
||||||
// Emit post hook
|
// Emit post hook
|
||||||
|
$event->setArgument('deletedShares', $deletedShares);
|
||||||
|
$this->eventDispatcher->dispatch('OCP\Share::postUnshare', $event);
|
||||||
\OC_Hook::emit('OCP\Share', 'post_unshare', $hookParams);
|
\OC_Hook::emit('OCP\Share', 'post_unshare', $hookParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue