$util = new Util($view, $userId);\r
$path = $util->fileIdToPath($params['itemSource']);\r
\r
+ //check if this is a reshare action, that's true if the item source is already shared with me\r
+ $sharedItem = \OCP\Share::getItemSharedWithBySource($params['itemType'], $params['itemSource']);\r
+ if ($sharedItem) {\r
+ // if it is a re-share than the file is located in my Shared folder\r
+ $path = '/Shared'.$sharedItem['file_target'];\r
+ } else {\r
+ $path = $util->fileIdToPath($params['itemSource']);\r
+ }\r
+\r
$sharingEnabled = \OCP\Share::isEnabled();\r
\r
+ // if a folder was shared, get a list if all (sub-)folders\r
if ($params['itemType'] === 'folder') {\r
$allFiles = $util->getAllFiles($path);\r
} else {\r
$util = new Util( $view, $userId );\r
$path = $util->fileIdToPath( $params['itemSource'] );\r
\r
+ // for group shares get a list of the group members\r
if ($params['shareType'] == \OCP\Share::SHARE_TYPE_GROUP) {\r
$userIds = \OC_Group::usersInGroup($params['shareWith']);\r
} else {\r
$userIds = array($params['shareWith']);\r
}\r
\r
+ // if we unshare a folder we need a list of all (sub-)files\r
if ($params['itemType'] === 'folder') {\r
$allFiles = $util->getAllFiles($path);\r
} else {\r