From 501f2971d48271eecf91da5f4da72e733ab4c3ce Mon Sep 17 00:00:00 2001 From: grnd-alt Date: Thu, 12 Feb 2026 10:18:15 +0100 Subject: [PATCH] fix: enable notifications for comments Signed-off-by: grnd-alt --- lib/Activity/ActivityManager.php | 6 ------ lib/AppInfo/Application.php | 2 ++ tests/integration/features/decks.feature | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index eab19da3b1..f1998604be 100644 --- a/lib/Activity/ActivityManager.php +++ b/lib/Activity/ActivityManager.php @@ -431,12 +431,6 @@ private function createEvent($objectType, $entity, $subject, $additionalParams = ->setSubject($subject, $subjectParams) ->setTimestamp(time()); - // FIXME: We currently require activities for comments even if they are disabled though settings - // Get rid of this once the frontend fetches comments/activity individually - if ($eventType === 'deck_comment') { - $event->setAuthor(self::DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED); - } - return $event; } diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 234af609fa..552b7f0771 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -62,6 +62,7 @@ use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent; use OCP\Comments\CommentsEntityEvent; use OCP\Comments\CommentsEvent; +use OCP\Comments\Events\CommentAddedEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Federation\ICloudFederationProvider; use OCP\Federation\ICloudFederationProviderManager; @@ -157,6 +158,7 @@ public function register(IRegistrationContext $context): void { $context->registerEventListener(AclUpdatedEvent::class, FullTextSearchEventListener::class); $context->registerEventListener(AclDeletedEvent::class, FullTextSearchEventListener::class); $context->registerEventListener(CommentsEvent::class, CommentEventListener::class); + $context->registerEventListener(CommentAddedEvent::class, CommentEventListener::class); // Handling cache invalidation for collections $context->registerEventListener(AclCreatedEvent::class, ResourceListener::class); diff --git a/tests/integration/features/decks.feature b/tests/integration/features/decks.feature index c0d186ef3e..0351f6269a 100644 --- a/tests/integration/features/decks.feature +++ b/tests/integration/features/decks.feature @@ -104,7 +104,7 @@ Feature: decks And remember the last attachment as "my-attachment" And post a comment with content "My first comment" on the card When get the activities for the last card - Then the fetched activities should have 2 entries + Then the fetched activities should have 3 entries And delete the card When get the activities for the last card