Skip to content

Commit

Permalink
fix: File listener
Browse files Browse the repository at this point in the history
- Catch all errors
- Don't access nodes that are non-existent

Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Apr 17, 2024
1 parent 745fa44 commit 7071cc4
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 185 deletions.
6 changes: 0 additions & 6 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use OCP\Files\Events\Node\NodeDeletedEvent;
use OCP\Files\Events\Node\NodeRenamedEvent;
use OCP\Files\Events\NodeRemovedFromCache;
use OCP\Files\IRootFolder;
use OCP\Share\Events\ShareCreatedEvent;
use OCP\Share\Events\ShareDeletedEvent;

Expand All @@ -43,11 +42,6 @@ public function __construct() {
$dispatcher->addServiceListener(ShareDeletedEvent::class, FileListener::class);
$dispatcher->addServiceListener(CacheEntryInsertedEvent::class, FileListener::class);
$dispatcher->addServiceListener(NodeRemovedFromCache::class, FileListener::class);
$rootFolder = $this->getContainer()->get(IRootFolder::class);
$rootFolder->listen('\OC\Files', 'postRename', function ($source, $target) {
$fileListener = $this->getContainer()->get(FileListener::class);
$fileListener->postRename($source, $target);
});
}

public function register(IRegistrationContext $context): void {
Expand Down
Loading

0 comments on commit 7071cc4

Please sign in to comment.