summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php1
-rw-r--r--lib/private/Share20/Manager.php10
2 files changed, 11 insertions, 0 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index c0c21bdb16c..46697910bbc 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -32,6 +32,7 @@ use OCP\IUserManager;
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;
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 899bd4ebfa1..0c49d0b6490 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -1049,6 +1049,16 @@ class Manager implements IManager {
// 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);
}