diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-13 17:29:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 17:29:57 +0200 |
commit | 82021b2b1bd6e6ae9c85564ba614797a1110e29c (patch) | |
tree | dcae47bf607411ae0e2e4e54ed5715aa98354c35 /apps/files_sharing/lib | |
parent | 14314584ba88ed8d8a7c8486b61c6677a14271f2 (diff) | |
parent | 4f5814c27bc43a8f10bd35f60bc3254697c50659 (diff) | |
download | nextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.tar.gz nextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.zip |
Merge pull request #5280 from nextcloud/shared-with-display-name
sharedWithDisplayName & sharedWithAvatar
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 9ad0e080f46..d30d5a05a22 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -212,8 +212,13 @@ class ShareAPIController extends OCSController { // "name (type, owner) [id]", depending on the Circles app version. $hasCircleId = (substr($share->getSharedWith(), -1) === ']'); - $displayNameLength = ($hasCircleId? strrpos($share->getSharedWith(), ' '): strlen($share->getSharedWith())); - $result['share_with_displayname'] = substr($share->getSharedWith(), 0, $displayNameLength); + $result['share_with_displayname'] = $share->getSharedWithDisplayName(); + if (empty($result['share_with_displayname'])) { + $displayNameLength = ($hasCircleId? strrpos($share->getSharedWith(), ' '): strlen($share->getSharedWith())); + $result['share_with_displayname'] = substr($share->getSharedWith(), 0, $displayNameLength); + } + + $result['share_with_avatar'] = $share->getSharedWithAvatar(); $shareWithStart = ($hasCircleId? strrpos($share->getSharedWith(), '[') + 1: 0); $shareWithLength = ($hasCircleId? -1: strpos($share->getSharedWith(), ' ')); |