diff options
author | Marcel Müller <marcel-mueller@gmx.de> | 2023-05-05 15:37:39 +0200 |
---|---|---|
committer | Marcel Müller <marcel-mueller@gmx.de> | 2023-05-08 22:10:09 +0200 |
commit | 1cf3b8a1322f6c1d3f43b1c2862319ff4b6e6cda (patch) | |
tree | 1a65fed575c2df199c115ccc25f593b120c6e7b6 /lib | |
parent | 49fb966d70c29e6573885998935de7d1a3d6b2e9 (diff) |
Add messageId to richObject in ReferenceProvider
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Collaboration/Reference/TalkReferenceProvider.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Collaboration/Reference/TalkReferenceProvider.php b/lib/Collaboration/Reference/TalkReferenceProvider.php index fcb3ad675..e6ac2ada6 100644 --- a/lib/Collaboration/Reference/TalkReferenceProvider.php +++ b/lib/Collaboration/Reference/TalkReferenceProvider.php @@ -177,6 +177,7 @@ class TalkReferenceProvider extends ADiscoverableReferenceProvider implements IS $roomName = $room->getDisplayName($this->userId); $title = $roomName; $description = ''; + $messageId = null; if ($participant instanceof Participant || $this->roomManager->isRoomListableByUser($room, $this->userId)) { @@ -190,7 +191,8 @@ class TalkReferenceProvider extends ADiscoverableReferenceProvider implements IS * 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); @@ -233,12 +235,18 @@ class TalkReferenceProvider extends ADiscoverableReferenceProvider implements IS $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); } /** |