diff --git a/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php b/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php index 9fde391787aa5..2bf10430e721b 100644 --- a/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php +++ b/lib/unstable/Sharing/Recipient/AShareRecipientTypeSearchCollaborator.php @@ -12,6 +12,7 @@ use NCU\Sharing\ShareAccessContext; use OCP\AppFramework\Attribute\Implementable; use OCP\Collaboration\Collaborators\ISearch; +use OCP\GlobalScale\IConfig as IGlobalScaleConfig; use OCP\IUser; use OCP\IUserSession; use OCP\Server; @@ -27,6 +28,8 @@ abstract class AShareRecipientTypeSearchCollaborator implements IShareRecipientT private ?ISearch $search = null; + private ?IGlobalScaleConfig $globalScaleConfig = null; + private function getUserSession(): IUserSession { return $this->userSession ??= Server::get(IUserSession::class); } @@ -35,6 +38,10 @@ private function getSearch(): ISearch { return $this->search ??= Server::get(ISearch::class); } + private function getGlobalScaleConfig(): IGlobalScaleConfig { + return $this->globalScaleConfig ??= Server::get(IGlobalScaleConfig::class); + } + /** * @return list * @experimental 35.0.0 @@ -73,7 +80,7 @@ public function searchRecipients(ShareAccessContext $accessContext, string $quer } // TODO: Maybe merge search requests from different recipient types backed by the collaborators API. - [$searchResults] = $this->getSearch()->filteredSearch($query, $this->getCollaboratorTypes(), true, 'unified-sharing', null, $limit, $offset); + [$searchResults] = $this->getSearch()->filteredSearch($query, $this->getCollaboratorTypes(), $this->getGlobalScaleConfig()->isGlobalScaleEnabled(), 'unified-sharing', null, $limit, $offset); $results = []; if (($exactResults = $searchResults['exact']) !== null) {