diff options
author | Joas Schilling <coding@schilljs.com> | 2023-07-11 11:06:29 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-07-18 16:19:01 +0200 |
commit | c3bc575d992c6816a89bb18734146c67ecdd17d2 (patch) | |
tree | b66e160b98418b18c508ab6232b682bca26d9260 /apps/dav/lib | |
parent | 705ccd50c566fdd7f484b5084e377169e60f7b6a (diff) | |
download | nextcloud-server-c3bc575d992c6816a89bb18734146c67ecdd17d2.tar.gz nextcloud-server-c3bc575d992c6816a89bb18734146c67ecdd17d2.zip |
fix(comments): Emit CommentsEntityEvent as typed event
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/Comments/RootCollection.php | 9 | ||||
-rw-r--r-- | apps/dav/lib/RootCollection.php | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/dav/lib/Comments/RootCollection.php b/apps/dav/lib/Comments/RootCollection.php index 39d644b4766..956980c900d 100644 --- a/apps/dav/lib/Comments/RootCollection.php +++ b/apps/dav/lib/Comments/RootCollection.php @@ -26,6 +26,7 @@ namespace OCA\DAV\Comments; use OCP\Comments\CommentsEntityEvent; use OCP\Comments\ICommentsManager; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IUserManager; use OCP\IUserSession; use Psr\Log\LoggerInterface; @@ -33,7 +34,6 @@ use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotAuthenticated; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\ICollection; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; class RootCollection implements ICollection { /** @var EntityTypeCollection[]|null */ @@ -43,13 +43,13 @@ class RootCollection implements ICollection { protected LoggerInterface $logger; protected IUserManager $userManager; protected IUserSession $userSession; - protected EventDispatcherInterface $dispatcher; + protected IEventDispatcher $dispatcher; public function __construct( ICommentsManager $commentsManager, IUserManager $userManager, IUserSession $userSession, - EventDispatcherInterface $dispatcher, + IEventDispatcher $dispatcher, LoggerInterface $logger) { $this->commentsManager = $commentsManager; $this->logger = $logger; @@ -74,7 +74,8 @@ class RootCollection implements ICollection { throw new NotAuthenticated(); } - $event = new CommentsEntityEvent(CommentsEntityEvent::EVENT_ENTITY); + $event = new CommentsEntityEvent(); + $this->dispatcher->dispatchTyped($event); $this->dispatcher->dispatch(CommentsEntityEvent::EVENT_ENTITY, $event); $this->entityTypeCollections = []; diff --git a/apps/dav/lib/RootCollection.php b/apps/dav/lib/RootCollection.php index 80d96f0d748..e4fd814ed81 100644 --- a/apps/dav/lib/RootCollection.php +++ b/apps/dav/lib/RootCollection.php @@ -139,7 +139,7 @@ class RootCollection extends SimpleCollection { \OC::$server->getCommentsManager(), $userManager, \OC::$server->getUserSession(), - \OC::$server->getEventDispatcher(), + $dispatcher, $logger ); |