fix(chatrelay): add reaction comment id to signaling message

Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
Anna Larch 2025-11-18 10:24:52 +01:00
parent 898b378d6d
commit 25c7b7bb6b
3 changed files with 9 additions and 3 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -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(),