Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand All @@ -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<IShare::TYPE_*>
* @experimental 35.0.0
Expand Down Expand Up @@ -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) {
Expand Down