The share manager knows which provider can accept shares

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-09-09 14:32:11 +02:00
parent 19e1892d50
commit e79ab7d0c5
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 1 additions and 6 deletions

View File

@ -966,11 +966,6 @@ class ShareAPIController extends OCSController {
throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist'));
}
if ($share->getShareType() !== IShare::TYPE_USER &&
$share->getShareType() !== IShare::TYPE_GROUP) {
throw new OCSNotFoundException($this->l->t('Share type does not support accepting'));
}
try {
$this->shareManager->acceptShare($share, $this->currentUser);
} catch (GenericShareException $e) {

View File

@ -943,7 +943,7 @@ class Manager implements IManager {
if (!method_exists($provider, 'acceptShare')) {
// TODO FIX ME
throw new \InvalidArgumentException('not supported');
throw new \InvalidArgumentException('Share provider does not support accepting');
}
$provider->acceptShare($share, $recipientId);
$event = new GenericEvent($share);