Skip to content

Commit 8431485

Browse files
committed
fix(comments): register event listener for typed comment events
Since the typed comment events (CommentAddedEvent, CommentUpdatedEvent, etc.) were introduced in NC34, dispatchTyped() dispatches using the exact subclass name. Registering only for CommentsEvent::class means the listener never fires, so comment mention notifications are never created or cleared. AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 354c641 commit 8431485

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

apps/comments/lib/AppInfo/Application.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
use OCP\AppFramework\Bootstrap\IRegistrationContext;
2525
use OCP\Comments\CommentsEntityEvent;
2626
use OCP\Comments\CommentsEvent;
27+
use OCP\Comments\Events\BeforeCommentUpdatedEvent;
28+
use OCP\Comments\Events\CommentAddedEvent;
29+
use OCP\Comments\Events\CommentDeletedEvent;
30+
use OCP\Comments\Events\CommentUpdatedEvent;
2731

2832
class Application extends App implements IBootstrap {
2933
public const APP_ID = 'comments';
@@ -48,7 +52,19 @@ public function register(IRegistrationContext $context): void {
4852
CommentsEntityEventListener::class
4953
);
5054
$context->registerEventListener(
51-
CommentsEvent::class,
55+
CommentAddedEvent::class,
56+
CommentsEventListener::class,
57+
);
58+
$context->registerEventListener(
59+
BeforeCommentUpdatedEvent::class,
60+
CommentsEventListener::class,
61+
);
62+
$context->registerEventListener(
63+
CommentUpdatedEvent::class,
64+
CommentsEventListener::class,
65+
);
66+
$context->registerEventListener(
67+
CommentDeletedEvent::class,
5268
CommentsEventListener::class,
5369
);
5470

0 commit comments

Comments
 (0)