From 25c7b7bb6b8fe9c1c74fbbfac38bca6cdf1f099a Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Tue, 18 Nov 2025 10:24:52 +0100 Subject: [PATCH] fix(chatrelay): add reaction comment id to signaling message Signed-off-by: Anna Larch --- lib/Chat/ReactionManager.php | 4 ++-- lib/Events/AReactionEvent.php | 6 ++++++ lib/Signaling/Listener.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Chat/ReactionManager.php b/lib/Chat/ReactionManager.php index 7e21979728..e20a1fe94f 100644 --- a/lib/Chat/ReactionManager.php +++ b/lib/Chat/ReactionManager.php @@ -80,7 +80,7 @@ class ReactionManager { $this->commentsManager->save($comment); - $event = new ReactionAddedEvent($chat, $parentMessage, $actorType, $actorId, $actorDisplayName, $reaction); + $event = new ReactionAddedEvent($chat, $parentMessage, $actorType, $actorId, $actorDisplayName, $reaction, $comment); $this->dispatcher->dispatchTyped($event); $this->notifier->notifyReacted($chat, $parentMessage, $comment); @@ -136,7 +136,7 @@ class ReactionManager { true ); - $event = new ReactionRemovedEvent($chat, $parentComment, $actorType, $actorId, $actorDisplayName, $reaction); + $event = new ReactionRemovedEvent($chat, $parentComment, $actorType, $actorId, $actorDisplayName, $reaction, $comment); $this->dispatcher->dispatchTyped($event); return $comment; diff --git a/lib/Events/AReactionEvent.php b/lib/Events/AReactionEvent.php index d56a404bac..664402f2b8 100644 --- a/lib/Events/AReactionEvent.php +++ b/lib/Events/AReactionEvent.php @@ -19,6 +19,7 @@ abstract class AReactionEvent extends ARoomEvent { protected string $actorId, protected string $actorDisplayName, protected string $reaction, + protected ?IComment $reactionMessage = null, ) { parent::__construct($room); } @@ -27,6 +28,11 @@ abstract class AReactionEvent extends ARoomEvent { return $this->message; } + public function getReactionMessage(): ?IComment { + return $this->reactionMessage; + } + + public function getActorType(): string { return $this->actorType; } diff --git a/lib/Signaling/Listener.php b/lib/Signaling/Listener.php index e39f86a95a..b6f5304d4b 100644 --- a/lib/Signaling/Listener.php +++ b/lib/Signaling/Listener.php @@ -563,7 +563,7 @@ class Listener implements IEventListener { $this->messageParser->parseMessage($message); // Build reaction message data $data['chat']['comment'] = [ - 'id' => null, + 'id' => $event->getReactionMessage()?->getId(), 'token' => $event->getRoom()->getToken(), 'actorType' => $event->getActorType(), 'actorId' => $event->getActorId(),