Skip to content

Commit

Permalink
Avoid share type 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Oct 18, 2022
1 parent 6cd9361 commit 58cbe18
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/Controller/Share20OcsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function __construct(

$this->dynamicShareTypes = [];
// FIXME: Move this line into the sciencemesh app:
$this->registerHelper(Share::SHARE_TYPE_SCIENCEMESH, 'sciencemesh', '\OCA\ScienceMesh\ShareProvider\ShareAPIHelper');
$this->registerHelper(Share::SHARE_TYPE_REMOTE, 'sciencemesh', '\OCA\ScienceMesh\ShareProvider\ShareAPIHelper');
}

public function registerHelper($shareType, $identifier, $helperClassName) {
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/Controller/ShareesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ protected function getUsers($search) {
$entry = [
'label' => $user["uuid"],
'value' => [
'shareType' => Share::SHARE_TYPE_SCIENCEMESH,
'shareType' => Share::SHARE_TYPE_REMOTE,
'shareWith' => $user["name"] ,
'userType' => User::USER_TYPE_GUEST,
],
Expand Down
1 change: 0 additions & 1 deletion lib/private/Share/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Constants {
public const SHARE_TYPE_GUEST = 4;
public const SHARE_TYPE_CONTACT = 5; // ToDo Check if it is still in use otherwise remove it
public const SHARE_TYPE_REMOTE = 6; // ToDo Check if it is still in use otherwise remove it
public const SHARE_TYPE_SCIENCEMESH = 1000;
public const CONVERT_SHARE_TYPE_TO_STRING = [
self::SHARE_TYPE_USER => 'user',
self::SHARE_TYPE_GROUP => 'group',
Expand Down
5 changes: 0 additions & 5 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,6 @@ protected function generalChecks(\OCP\Share\IShare $share) {
throw new \InvalidArgumentException('SharedWith should not be empty');
}
}
elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_SCIENCEMESH) {
if ($share->getSharedWith() === null) {
throw new \InvalidArgumentException('SharedWith should not be empty');
}
}
else {
// We can't handle other types yet
throw new \InvalidArgumentException('Unknown share type');
Expand Down

0 comments on commit 58cbe18

Please sign in to comment.