The share manager knows which provider can accept shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
19e1892d50
commit
e79ab7d0c5
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue