Skip to content
Snippets Groups Projects
Commit 4b8717df authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #7416 from owncloud/share_api_7311

[share api] only add "received_from" field if a share was found
parents d9a153db 3be5e48b
No related branches found
No related tags found
No related merge requests found
......@@ -172,12 +172,12 @@ class Api {
// workaround because folders are named 'dir' in this context
$itemType = $file['type'] === 'file' ? 'file' : 'folder';
$share = \OCP\Share::getItemShared($itemType, $file['fileid']);
if($share) {
$receivedFrom = \OCP\Share::getItemSharedWithBySource($itemType, $file['fileid']);
if ($receivedFrom) {
$share['received_from'] = $receivedFrom['uid_owner'];
$share['received_from_displayname'] = \OCP\User::getDisplayName($receivedFrom['uid_owner']);
}
if ($share) {
$result = array_merge($result, $share);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment