diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 10876e1656..82a93c446e 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -200,8 +200,16 @@ class ShareAPIController extends OCSController { $result['share_with_displayname'] = $this->getDisplayNameFromAddressBook($share->getSharedWith(), 'EMAIL'); $result['token'] = $share->getToken(); } else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_CIRCLE) { - $result['share_with_displayname'] = $share->getSharedWith(); - $result['share_with'] = explode(' ', $share->getSharedWith(), 2)[0]; + // getSharedWith() returns either "name (type, owner)" or + // "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); + + $shareWithStart = ($hasCircleId? strrpos($share->getSharedWith(), '[') + 1: 0); + $shareWithLength = ($hasCircleId? -1: strpos($share->getSharedWith(), ' ')); + $result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength); } diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 6c256d3de3..8ec53810b5 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -241,7 +241,7 @@ shareWithTitle: shareWithTitle, shareType: shareType, shareId: this.model.get('shares')[shareIndex].id, - modSeed: shareType !== OC.Share.SHARE_TYPE_USER, + modSeed: shareType !== OC.Share.SHARE_TYPE_USER && shareType !== OC.Share.SHARE_TYPE_CIRCLE, isRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE, isMailShare: shareType === OC.Share.SHARE_TYPE_EMAIL, isCircleShare: shareType === OC.Share.SHARE_TYPE_CIRCLE, diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 6b65e46b25..d2c6349014 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -338,7 +338,7 @@ } var insert = $("
"); var avatar = $("").appendTo(insert); - if (item.value.shareType === OC.Share.SHARE_TYPE_USER) { + if (item.value.shareType === OC.Share.SHARE_TYPE_USER || item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) { avatar.avatar(item.value.shareWith, 32, undefined, undefined, undefined, item.label); } else { avatar.imageplaceholder(text, undefined, 32);