summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@nextcloud.com>2017-06-06 10:21:42 -0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-05-21 01:24:45 +0200
commit0009adae80cf9b3f8bcc40bd3f75d2a3f2cee6ad (patch)
tree22a62264854300ff73a62bcf94262d5fcad86adf /apps/files_sharing/lib
parentca089b9412af79cc696342968a657991755a2e2e (diff)
downloadnextcloud-server-0009adae80cf9b3f8bcc40bd3f75d2a3f2cee6ad.tar.gz
nextcloud-server-0009adae80cf9b3f8bcc40bd3f75d2a3f2cee6ad.zip
SharedWithDisplayName + SharedWithAvatar
Signed-off-by: Maxence Lange <maxence@nextcloud.com> Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php9
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 30a8ded2a4a..73c3e5951b0 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(), ' '));