Skip to content

Commit 9700875

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 9700875

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

apps/comments/lib/AppInfo/Application.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
use OCP\AppFramework\Bootstrap\IBootstrap;
2424
use OCP\AppFramework\Bootstrap\IRegistrationContext;
2525
use OCP\Comments\CommentsEntityEvent;
26-
use OCP\Comments\CommentsEvent;
26+
use OCP\Comments\Events\BeforeCommentUpdatedEvent;
27+
use OCP\Comments\Events\CommentAddedEvent;
28+
use OCP\Comments\Events\CommentDeletedEvent;
29+
use OCP\Comments\Events\CommentUpdatedEvent;
2730

2831
class Application extends App implements IBootstrap {
2932
public const APP_ID = 'comments';
@@ -48,7 +51,19 @@ public function register(IRegistrationContext $context): void {
4851
CommentsEntityEventListener::class
4952
);
5053
$context->registerEventListener(
51-
CommentsEvent::class,
54+
CommentAddedEvent::class,
55+
CommentsEventListener::class,
56+
);
57+
$context->registerEventListener(
58+
BeforeCommentUpdatedEvent::class,
59+
CommentsEventListener::class,
60+
);
61+
$context->registerEventListener(
62+
CommentUpdatedEvent::class,
63+
CommentsEventListener::class,
64+
);
65+
$context->registerEventListener(
66+
CommentDeletedEvent::class,
5267
CommentsEventListener::class,
5368
);
5469

0 commit comments

Comments
 (0)