Skip to content

Commit

Permalink
Merge pull request #34374 from nextcloud/backport/34219/stable25
Browse files Browse the repository at this point in the history
[stable25] Add fallback options for contacts array
  • Loading branch information
blizzz authored Oct 3, 2022
2 parents d847a89 + b1617bc commit 46180dd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/private/Collaboration/Collaborators/MailPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) {
if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
$singleResult = [[
'label' => $displayName,
'uuid' => $contact['UID'],
'name' => $contact['FN'],
'uuid' => $contact['UID'] ?? $emailAddress,
'name' => $contact['FN'] ?? $displayName,
'value' => [
'shareType' => IShare::TYPE_USER,
'shareWith' => $cloud->getUser(),
Expand Down Expand Up @@ -205,8 +205,8 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) {
if ($addToWide && !$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
$userResults['wide'][] = [
'label' => $displayName,
'uuid' => $contact['UID'],
'name' => $contact['FN'],
'uuid' => $contact['UID'] ?? $emailAddress,
'name' => $contact['FN'] ?? $displayName,
'value' => [
'shareType' => IShare::TYPE_USER,
'shareWith' => $cloud->getUser(),
Expand All @@ -226,8 +226,8 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) {
}
$result['exact'][] = [
'label' => $displayName,
'uuid' => $contact['UID'],
'name' => $contact['FN'],
'uuid' => $contact['UID'] ?? $emailAddress,
'name' => $contact['FN'] ?? $displayName,
'type' => $emailAddressType ?? '',
'value' => [
'shareType' => IShare::TYPE_EMAIL,
Expand All @@ -237,8 +237,8 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) {
} else {
$result['wide'][] = [
'label' => $displayName,
'uuid' => $contact['UID'],
'name' => $contact['FN'],
'uuid' => $contact['UID'] ?? $emailAddress,
'name' => $contact['FN'] ?? $displayName,
'type' => $emailAddressType ?? '',
'value' => [
'shareType' => IShare::TYPE_EMAIL,
Expand Down

0 comments on commit 46180dd

Please sign in to comment.