Skip to content

Commit 9ae0d20

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 c9c8e1b commit 9ae0d20

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
public function search($search, $limit, $offset, ISearchResult $searchResult): bool {
@@ -73,9 +70,6 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b
7370
]);
7471
continue;
7572
}
76-
if ($this->currentUserRemote === $remote) {
77-
continue;
78-
}
7973
$name = $lookup['name']['value'] ?? '';
8074
$label = empty($name) ? $lookup['federationId'] : $name . ' (' . $lookup['federationId'] . ')';
8175
$result[] = [

lib/private/Collaboration/Collaborators/Search.php

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

0 commit comments

Comments
 (0)