diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-10-07 12:31:30 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-12-14 11:14:59 +0100 |
commit | 131fcac91ed0468d6564eb268c85b6665e06f330 (patch) | |
tree | 0b18596235799bb50c688307cf0e26b7d0a138f5 /lib/private/Collaboration | |
parent | a86746ea08be193ae69c4dcbf8001c9032c1a2c1 (diff) | |
download | nextcloud-server-131fcac91ed0468d6564eb268c85b6665e06f330.tar.gz nextcloud-server-131fcac91ed0468d6564eb268c85b6665e06f330.zip |
Show unique displayname context in the sharing input
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Collaboration')
-rw-r--r-- | lib/private/Collaboration/Collaborators/MailPlugin.php | 3 | ||||
-rw-r--r-- | lib/private/Collaboration/Collaborators/RemotePlugin.php | 3 | ||||
-rw-r--r-- | lib/private/Collaboration/Collaborators/UserPlugin.php | 5 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index 90dc5919176..7bdd29afc4e 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -136,6 +136,8 @@ class MailPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $cloud->getUser(), ], + 'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser() + ]]; $searchResult->addResultSet($userType, [], $singleResult); $searchResult->markExactIdMatch($emailType); @@ -170,6 +172,7 @@ class MailPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $cloud->getUser(), ], + 'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser() ]; continue; } diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php index af94027fbe9..3d9b1f9847a 100644 --- a/lib/private/Collaboration/Collaborators/RemotePlugin.php +++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php @@ -103,7 +103,8 @@ class RemotePlugin implements ISearchPlugin { 'value' => [ 'shareType' => IShare::TYPE_USER, 'shareWith' => $remoteUser - ] + ], + 'shareWithDisplayNameUnique' => $contact['EMAIL'] !== null && $contact['EMAIL'] !== '' ? $contact['EMAIL'] : $contact['UID'], ]; } diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index cd4963197ae..0b51a29ae25 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -162,6 +162,7 @@ class UserPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $uid, ], + 'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid, 'status' => $status, ]; } else { @@ -186,6 +187,7 @@ class UserPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $uid, ], + 'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid, 'status' => $status, ]; } @@ -207,6 +209,8 @@ class UserPlugin implements ISearchPlugin { if ($addUser) { $status = []; + $uid = $user->getUID(); + $userEmail = $user->getEMailAddress(); if (array_key_exists($user->getUID(), $userStatuses)) { $userStatus = $userStatuses[$user->getUID()]; $status = [ @@ -227,6 +231,7 @@ class UserPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $user->getUID(), ], + 'shareWithDisplayNameUnique' => $userEmail !== null && $userEmail !== '' ? $userEmail : $uid, 'status' => $status, ]; } |