diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-03-23 10:32:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 10:32:06 +0300 |
commit | 287cc49f0422cf120ddadba5bc18c7b68b2e1457 (patch) | |
tree | bad514ecc1218c16ed3c9dc9f03f33f00867b6f9 /lib | |
parent | 02a9951b5f1d2511943def3f4ca72846b8de68ef (diff) | |
parent | 56e4f85badb296d4dbd61614850237b7f1503a6b (diff) |
Merge pull request #7023 from nextcloud/bugfix/noid/set-share-with-link-url-only-when-accessible
Only add the share_with_link url when the link is accessible
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Share/Helper/ShareAPIController.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Share/Helper/ShareAPIController.php b/lib/Share/Helper/ShareAPIController.php index 29faae6db..95554c7ae 100644 --- a/lib/Share/Helper/ShareAPIController.php +++ b/lib/Share/Helper/ShareAPIController.php @@ -87,16 +87,17 @@ class ShareAPIController { $result['share_with_displayname'] = $room->getDisplayName($this->userId); try { $room->getParticipant($this->userId, false); + $result['share_with_link'] = $this->urlGenerator->linkToRouteAbsolute('spreed.Page.showCall', ['token' => $room->getToken()]); } catch (ParticipantNotFoundException $e) { // Removing the conversation token from the leaked data if not a participant. // Adding some unique but reproducable part to the share_with here // so the avatars for conversations are distinguishable $result['share_with'] = 'private_conversation_' . substr(sha1($room->getName() . $room->getId()), 0, 6); + $result['share_with_link'] = ''; } if ($room->getType() === Room::TYPE_PUBLIC) { $result['token'] = $share->getToken(); } - $result['share_with_link'] = $this->urlGenerator->linkToRouteAbsolute('spreed.Page.showCall', ['token' => $room->getToken()]); return $result; } |