From a09df0083e6fa5c465c85d58ea04981538b41c32 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 11 Mar 2014 12:59:37 +0100 Subject: [PATCH] add 'received_from' info to the share, so that every share can have a different value --- apps/files_sharing/lib/api.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index dc95a791d2..7adbcab2f9 100644 --- a/apps/files_sharing/lib/api.php +++ b/apps/files_sharing/lib/api.php @@ -175,8 +175,10 @@ class Api { 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']); + reset($share); + $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); }