Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
use OCP\Mail\IMailer;
use OCP\Security\ISecureRandom;
use OC\Share20\Share;
+use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
// If it is not a link share try to fetch a federated share by token
if ($share === null) {
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_REMOTE);
+ try {
+ $share = $provider->getShareByToken($token);
+ } catch (ShareNotFound $e) {
+ $share = null;
+ }
+ }
+
+ // If it is not a link share try to fetch a federated share by token
+ if ($share === null && $this->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) {
+ $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_EMAIL);
$share = $provider->getShareByToken($token);
}