add 'received_from' info to the share, so that every share can have a different value

This commit is contained in:
Bjoern Schiessle 2014-03-11 12:59:37 +01:00
parent 36885dc64c
commit a09df0083e

View file

@ -175,8 +175,10 @@ class Api {
if($share) { if($share) {
$receivedFrom = \OCP\Share::getItemSharedWithBySource($itemType, $file['fileid']); $receivedFrom = \OCP\Share::getItemSharedWithBySource($itemType, $file['fileid']);
if ($receivedFrom) { if ($receivedFrom) {
$share['received_from'] = $receivedFrom['uid_owner']; reset($share);
$share['received_from_displayname'] = \OCP\User::getDisplayName($receivedFrom['uid_owner']); $key = key($share);
$share[$key]['received_from'] = $receivedFrom['uid_owner'];
$share[$key]['received_from_displayname'] = \OCP\User::getDisplayName($receivedFrom['uid_owner']);
} }
$result = array_merge($result, $share); $result = array_merge($result, $share);
} }