From be6362bba493df7c14590ec9e628e76b2dbd2cb2 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 25 Feb 2026 11:19:53 -0100 Subject: [PATCH] feat(lookup): search for local account only via lookupserver Signed-off-by: Maxence Lange d d --- lib/private/Collaboration/Collaborators/LookupPlugin.php | 6 ------ lib/private/Collaboration/Collaborators/Search.php | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php index de1bfa9edb932..29915625e1ad1 100644 --- a/lib/private/Collaboration/Collaborators/LookupPlugin.php +++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php @@ -18,8 +18,6 @@ use Psr\Log\LoggerInterface; class LookupPlugin implements ISearchPlugin { - /** @var string remote part of the current user's cloud id */ - private string $currentUserRemote; public function __construct( private IConfig $config, @@ -30,7 +28,6 @@ public function __construct( private ?TrustedServers $trustedServers, ) { $currentUserCloudId = $userSession->getUser()->getCloudId(); - $this->currentUserRemote = $cloudIdManager->resolveCloudId($currentUserCloudId)->getRemote(); } #[\Override] @@ -74,9 +71,6 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b ]); continue; } - if ($this->currentUserRemote === $remote) { - continue; - } $name = $lookup['name']['value'] ?? ''; $label = empty($name) ? $lookup['federationId'] : $name . ' (' . $lookup['federationId'] . ')'; $result[] = [ diff --git a/lib/private/Collaboration/Collaborators/Search.php b/lib/private/Collaboration/Collaborators/Search.php index 78079397234da..838231244565c 100644 --- a/lib/private/Collaboration/Collaborators/Search.php +++ b/lib/private/Collaboration/Collaborators/Search.php @@ -46,6 +46,10 @@ public function search($search, array $shareTypes, $lookup, $limit, $offset): ar foreach ($this->pluginList[$type] as $plugin) { /** @var ISearchPlugin $searchPlugin */ $searchPlugin = $this->container->resolve($plugin); + if ($searchPlugin instanceof UserPlugin && $lookup) { + // we are in GlobalScale, we ignore local accounts and prefer the result from lookup + continue; + } $hasMoreResults = $searchPlugin->search($search, $limit, $offset, $searchResult) || $hasMoreResults; } }