diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 97cefa71..8ec211fb 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -21,7 +21,7 @@ use OCP\Files\Events\Node\NodeDeletedEvent; use OCP\Files\Events\Node\NodeRenamedEvent; use OCP\Files\Events\NodeRemovedFromCache; -use OCP\Share\Events\ShareCreatedEvent; +use OCP\Share\Events\ShareAcceptedEvent; use OCP\Share\Events\ShareDeletedEvent; class Application extends App implements IBootstrap { @@ -38,7 +38,7 @@ public function __construct() { $dispatcher->addServiceListener(NodeCreatedEvent::class, FileListener::class); $dispatcher->addServiceListener(NodeRenamedEvent::class, FileListener::class); $dispatcher->addServiceListener(BeforeNodeRenamedEvent::class, FileListener::class); - $dispatcher->addServiceListener(ShareCreatedEvent::class, FileListener::class); + $dispatcher->addServiceListener(ShareAcceptedEvent::class, FileListener::class); $dispatcher->addServiceListener(ShareDeletedEvent::class, FileListener::class); $dispatcher->addServiceListener(CacheEntryInsertedEvent::class, FileListener::class); $dispatcher->addServiceListener(NodeRemovedFromCache::class, FileListener::class); diff --git a/lib/Hooks/FileListener.php b/lib/Hooks/FileListener.php index 9d3b325f..8edf5a82 100644 --- a/lib/Hooks/FileListener.php +++ b/lib/Hooks/FileListener.php @@ -34,7 +34,7 @@ use OCP\Files\IRootFolder; use OCP\Files\Node; use OCP\Files\NotFoundException; -use OCP\Share\Events\ShareCreatedEvent; +use OCP\Share\Events\ShareAcceptedEvent; use OCP\Share\Events\ShareDeletedEvent; use Psr\Log\LoggerInterface; @@ -62,7 +62,7 @@ public function __construct( public function handle(Event $event): void { try { - if ($event instanceof ShareCreatedEvent) { + if ($event instanceof ShareAcceptedEvent) { $share = $event->getShare(); $ownerId = $share->getShareOwner(); $node = $share->getNode();