From 6436795b192f67601276054479a789803babab9b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 10 Apr 2019 10:25:32 +0200 Subject: Remove conversation names and tokens when you are not a participant Signed-off-by: Joas Schilling --- lib/Share/Helper/ShareAPIController.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Share') diff --git a/lib/Share/Helper/ShareAPIController.php b/lib/Share/Helper/ShareAPIController.php index 64398f56a..04ecfdc4d 100644 --- a/lib/Share/Helper/ShareAPIController.php +++ b/lib/Share/Helper/ShareAPIController.php @@ -85,6 +85,14 @@ class ShareAPIController { } $result['share_with_displayname'] = $room->getDisplayName($this->userId); + try { + $room->getParticipant($this->userId); + } 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); + } if ($room->getType() === Room::PUBLIC_CALL) { $result['token'] = $share->getToken(); } -- cgit v1.2.3