Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Collaboration')
-rw-r--r--lib/Collaboration/Collaborators/RoomPlugin.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Collaboration/Collaborators/RoomPlugin.php b/lib/Collaboration/Collaborators/RoomPlugin.php
index ea9e92d8e..cc03429fe 100644
--- a/lib/Collaboration/Collaborators/RoomPlugin.php
+++ b/lib/Collaboration/Collaborators/RoomPlugin.php
@@ -25,6 +25,8 @@ declare(strict_types=1);
namespace OCA\Talk\Collaboration\Collaborators;
use OCA\Talk\Manager;
+use OCA\Talk\Model\Attendee;
+use OCA\Talk\Participant;
use OCA\Talk\Room;
use OCP\Collaboration\Collaborators\ISearchPlugin;
use OCP\Collaboration\Collaborators\ISearchResult;
@@ -62,6 +64,12 @@ class RoomPlugin implements ISearchPlugin {
continue;
}
+ $participant = $room->getParticipant($userId, false);
+ if (!$participant instanceof Participant || !($participant->getPermissions() & Attendee::PERMISSIONS_CHAT)) {
+ // No chat permissions is like read-only
+ continue;
+ }
+
if (stripos($room->getDisplayName($userId), $search) !== false) {
$item = $this->roomToSearchResultItem($room, $userId);