Do not overwrite the shareType so the post hook is still correct

This commit is contained in:
Joas Schilling 2015-02-09 12:59:29 +01:00
parent e2d4b3c123
commit 31b93ac19a

View file

@ -1850,7 +1850,7 @@ class Share extends \OC\Share\Constants {
$sourceId = ($itemType === 'file' || $itemType === 'folder') ? $fileSource : $itemSource;
$sourceExists = self::getItemSharedWithBySource($itemType, $sourceId, self::FORMAT_NONE, null, true, $user);
$shareType = ($isGroupShare) ? self::$shareTypeGroupUserUnique : $shareType;
$userShareType = ($isGroupShare) ? self::$shareTypeGroupUserUnique : $shareType;
if ($sourceExists) {
$fileTarget = $sourceExists['file_target'];
@ -1863,12 +1863,12 @@ class Share extends \OC\Share\Constants {
} elseif(!$sourceExists && !$isGroupShare) {
$itemTarget = Helper::generateTarget($itemType, $itemSource, $shareType, $user,
$itemTarget = Helper::generateTarget($itemType, $itemSource, $userShareType, $user,
$uidOwner, $suggestedItemTarget, $parent);
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {
$fileTarget = Helper::generateTarget('file', $filePath, $shareType, $user,
$fileTarget = Helper::generateTarget('file', $filePath, $userShareType, $user,
$uidOwner, $suggestedFileTarget, $parent);
if ($fileTarget != $groupFileTarget) {
$parentFolders[$user]['folder'] = $fileTarget;
@ -1878,7 +1878,7 @@ class Share extends \OC\Share\Constants {
$parent = $parentFolder[$user]['id'];
}
} else {
$fileTarget = Helper::generateTarget('file', $filePath, $shareType,
$fileTarget = Helper::generateTarget('file', $filePath, $userShareType,
$user, $uidOwner, $suggestedFileTarget, $parent);
}
} else {
@ -1909,7 +1909,7 @@ class Share extends \OC\Share\Constants {
'itemType' => $itemType,
'itemSource' => $itemSource,
'itemTarget' => $itemTarget,
'shareType' => $shareType,
'shareType' => $userShareType,
'shareWith' => $user,
'uidOwner' => $uidOwner,
'permissions' => $permissions,