Skip to content

Commit a751655

Browse files
provokateurinbackportbot[bot]
authored andcommitted
fix(Collaborators): Fix matching emails to remote users if no remote results are present
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 4d5cf23 commit a751655

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

lib/private/Collaboration/Collaborators/Search.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ protected function dropMailSharesWhereRemoteShareIsPossible(ISearchResult $searc
9595
$allResults = $searchResult->asArray();
9696

9797
$emailType = new SearchResultType('emails');
98-
$remoteType = new SearchResultType('remotes');
99-
10098
$emailLabel = $emailType->getLabel();
10199
$emailEntries = array_merge(
102100
$allResults['exact'][$emailLabel] ?? [],
@@ -115,14 +113,18 @@ protected function dropMailSharesWhereRemoteShareIsPossible(ISearchResult $searc
115113
$mailIdMap[$mailRow['uuid']] = $mailRow['value']['shareWith'];
116114
}
117115

118-
foreach ($allResults[$remoteType->getLabel()] as $resultRow) {
119-
if (!isset($resultRow['uuid'])) {
120-
continue;
121-
}
122-
if (isset($mailIdMap[$resultRow['uuid']])) {
123-
$searchResult->removeCollaboratorResult($emailType, $mailIdMap[$resultRow['uuid']]);
116+
$remoteType = new SearchResultType('remotes');
117+
if (isset($allResults[$remoteType->getLabel()])) {
118+
foreach ($allResults[$remoteType->getLabel()] as $resultRow) {
119+
if (!isset($resultRow['uuid'])) {
120+
continue;
121+
}
122+
if (isset($mailIdMap[$resultRow['uuid']])) {
123+
$searchResult->removeCollaboratorResult($emailType, $mailIdMap[$resultRow['uuid']]);
124+
}
124125
}
125126
}
127+
126128
$lookupType = new SearchResultType('lookup');
127129
if (isset($allResults[$lookupType->getLabel()])) {
128130
foreach ($allResults[$lookupType->getLabel()] as $resultRow) {

0 commit comments

Comments
 (0)