Skip to content

Commit

Permalink
Add messageId to richObject in ReferenceProvider
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
  • Loading branch information
SystemKeeper committed May 8, 2023
1 parent 49fb966 commit 1cf3b8a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/Collaboration/Reference/TalkReferenceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ protected function fetchReference(Reference $reference): void {
$roomName = $room->getDisplayName($this->userId);
$title = $roomName;
$description = '';
$messageId = null;

if ($participant instanceof Participant
|| $this->roomManager->isRoomListableByUser($room, $this->userId)) {
Expand All @@ -190,7 +191,8 @@ protected function fetchReference(Reference $reference): void {
* Description is the plain text chat message
*/
if ($participant && !empty($referenceMatch['message'])) {
$comment = $this->chatManager->getComment($room, (string) $referenceMatch['message']);
$messageId = (string) $referenceMatch['message'];
$comment = $this->chatManager->getComment($room, $messageId);
$message = $this->messageParser->createMessage($room, $participant, $comment, $this->l);
$this->messageParser->parseMessage($message);

Expand Down Expand Up @@ -233,12 +235,18 @@ protected function fetchReference(Reference $reference): void {
$reference->setUrl($this->urlGenerator->linkToRouteAbsolute('spreed.Page.showCall', ['token' => $room->getToken()]));
$reference->setImageUrl($this->avatarService->getAvatarUrl($room));

$reference->setRichObject('call', [
$referenceData = [
'id' => $room->getToken(),
'name' => $roomName,
'link' => $reference->getUrl(),
'call-type' => $this->getRoomType($room),
]);
];

if ($messageId) {
$referenceData['message-id'] = $messageId;
}

$reference->setRichObject('call', $referenceData);
}

/**
Expand Down

0 comments on commit 1cf3b8a

Please sign in to comment.