Skip to content

Commit be6362b

Browse files
ArtificialOwlbackportbot[bot]
authored andcommitted
feat(lookup): search for local account only via lookupserver
Signed-off-by: Maxence Lange <maxence@artificial-owl.com> d d
1 parent 5b11d78 commit be6362b

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

lib/private/Collaboration/Collaborators/LookupPlugin.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
use Psr\Log\LoggerInterface;
1919

2020
class LookupPlugin implements ISearchPlugin {
21-
/** @var string remote part of the current user's cloud id */
22-
private string $currentUserRemote;
2321

2422
public function __construct(
2523
private IConfig $config,
@@ -30,7 +28,6 @@ public function __construct(
3028
private ?TrustedServers $trustedServers,
3129
) {
3230
$currentUserCloudId = $userSession->getUser()->getCloudId();
33-
$this->currentUserRemote = $cloudIdManager->resolveCloudId($currentUserCloudId)->getRemote();
3431
}
3532

3633
#[\Override]
@@ -74,9 +71,6 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b
7471
]);
7572
continue;
7673
}
77-
if ($this->currentUserRemote === $remote) {
78-
continue;
79-
}
8074
$name = $lookup['name']['value'] ?? '';
8175
$label = empty($name) ? $lookup['federationId'] : $name . ' (' . $lookup['federationId'] . ')';
8276
$result[] = [

lib/private/Collaboration/Collaborators/Search.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public function search($search, array $shareTypes, $lookup, $limit, $offset): ar
4646
foreach ($this->pluginList[$type] as $plugin) {
4747
/** @var ISearchPlugin $searchPlugin */
4848
$searchPlugin = $this->container->resolve($plugin);
49+
if ($searchPlugin instanceof UserPlugin && $lookup) {
50+
// we are in GlobalScale, we ignore local accounts and prefer the result from lookup
51+
continue;
52+
}
4953
$hasMoreResults = $searchPlugin->search($search, $limit, $offset, $searchResult) || $hasMoreResults;
5054
}
5155
}

0 commit comments

Comments
 (0)