mirror of
https://github.com/nextcloud/server.git
synced 2026-06-28 01:50:42 -04:00
fix(Collaborators): Fix matching emails to remote users if no remote results are present
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
36fdc11387
commit
58111c207b
1 changed files with 10 additions and 8 deletions
|
|
@ -92,8 +92,6 @@ class Search implements ISearch {
|
|||
$allResults = $searchResult->asArray();
|
||||
|
||||
$emailType = new SearchResultType('emails');
|
||||
$remoteType = new SearchResultType('remotes');
|
||||
|
||||
$emailLabel = $emailType->getLabel();
|
||||
$emailEntries = array_merge(
|
||||
$allResults['exact'][$emailLabel] ?? [],
|
||||
|
|
@ -112,14 +110,18 @@ class Search implements ISearch {
|
|||
$mailIdMap[$mailRow['uuid']] = $mailRow['value']['shareWith'];
|
||||
}
|
||||
|
||||
foreach ($allResults[$remoteType->getLabel()] as $resultRow) {
|
||||
if (!isset($resultRow['uuid'])) {
|
||||
continue;
|
||||
}
|
||||
if (isset($mailIdMap[$resultRow['uuid']])) {
|
||||
$searchResult->removeCollaboratorResult($emailType, $mailIdMap[$resultRow['uuid']]);
|
||||
$remoteType = new SearchResultType('remotes');
|
||||
if (isset($allResults[$remoteType->getLabel()])) {
|
||||
foreach ($allResults[$remoteType->getLabel()] as $resultRow) {
|
||||
if (!isset($resultRow['uuid'])) {
|
||||
continue;
|
||||
}
|
||||
if (isset($mailIdMap[$resultRow['uuid']])) {
|
||||
$searchResult->removeCollaboratorResult($emailType, $mailIdMap[$resultRow['uuid']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$lookupType = new SearchResultType('lookup');
|
||||
if (isset($allResults[$lookupType->getLabel()])) {
|
||||
foreach ($allResults[$lookupType->getLabel()] as $resultRow) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue