summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/composer/composer/autoload_classmap.php1
-rw-r--r--apps/files_sharing/composer/composer/autoload_static.php1
-rw-r--r--apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php18
-rw-r--r--lib/private/Collaboration/AutoComplete/Manager.php2
4 files changed, 17 insertions, 5 deletions
diff --git a/apps/files_sharing/composer/composer/autoload_classmap.php b/apps/files_sharing/composer/composer/autoload_classmap.php
index 48b9651a00d..a68db3421b6 100644
--- a/apps/files_sharing/composer/composer/autoload_classmap.php
+++ b/apps/files_sharing/composer/composer/autoload_classmap.php
@@ -19,6 +19,7 @@ return array(
'OCA\\Files_Sharing\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
'OCA\\Files_Sharing\\Cache' => $baseDir . '/../lib/Cache.php',
'OCA\\Files_Sharing\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
+ 'OCA\\Files_Sharing\\Collaboration\\ShareRecipientSorter' => $baseDir . '/../lib/Collaboration/ShareRecipientSorter.php',
'OCA\\Files_Sharing\\Command\\CleanupRemoteStorages' => $baseDir . '/../lib/Command/CleanupRemoteStorages.php',
'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => $baseDir . '/../lib/Controller/ExternalSharesController.php',
'OCA\\Files_Sharing\\Controller\\PublicPreviewController' => $baseDir . '/../lib/Controller/PublicPreviewController.php',
diff --git a/apps/files_sharing/composer/composer/autoload_static.php b/apps/files_sharing/composer/composer/autoload_static.php
index caabc5d50a3..311dd9a702e 100644
--- a/apps/files_sharing/composer/composer/autoload_static.php
+++ b/apps/files_sharing/composer/composer/autoload_static.php
@@ -34,6 +34,7 @@ class ComposerStaticInitf32f03f7cd82bff20d6a51be16689441
'OCA\\Files_Sharing\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
'OCA\\Files_Sharing\\Cache' => __DIR__ . '/..' . '/../lib/Cache.php',
'OCA\\Files_Sharing\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
+ 'OCA\\Files_Sharing\\Collaboration\\ShareRecipientSorter' => __DIR__ . '/..' . '/../lib/Collaboration/ShareRecipientSorter.php',
'OCA\\Files_Sharing\\Command\\CleanupRemoteStorages' => __DIR__ . '/..' . '/../lib/Command/CleanupRemoteStorages.php',
'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => __DIR__ . '/..' . '/../lib/Controller/ExternalSharesController.php',
'OCA\\Files_Sharing\\Controller\\PublicPreviewController' => __DIR__ . '/..' . '/../lib/Controller/PublicPreviewController.php',
diff --git a/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php b/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php
index 1a722817cbd..5d19ed5d427 100644
--- a/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php
+++ b/apps/files_sharing/lib/Collaboration/ShareRecipientSorter.php
@@ -26,7 +26,9 @@ namespace OCA\Files_Sharing\Collaboration;
use OCP\Collaboration\AutoComplete\ISorter;
use OCP\Files\Folder;
+use OCP\Files\IRootFolder;
use OCP\Files\Node;
+use OCP\IUserSession;
use OCP\Share\IManager;
class ShareRecipientSorter implements ISorter {
@@ -34,11 +36,14 @@ class ShareRecipientSorter implements ISorter {
/** @var IManager */
private $shareManager;
/** @var Folder */
- private $userFolder;
+ private $rootFolder;
+ /** @var IUserSession */
+ private $userSession;
- public function __construct(IManager $shareManager, Folder $userFolder) {
+ public function __construct(IManager $shareManager, IRootFolder $rootFolder, IUserSession $userSession) {
$this->shareManager = $shareManager;
- $this->userFolder = $userFolder;
+ $this->rootFolder = $rootFolder;
+ $this->userSession = $userSession;
}
public function getId() {
@@ -51,7 +56,12 @@ class ShareRecipientSorter implements ISorter {
return;
}
/** @var Node[] $nodes */
- $nodes = $this->userFolder->getById((int)$context['itemId']);
+ $user = $this->userSession->getUser();
+ if($user === null) {
+ return;
+ }
+ $userFolder = $this->rootFolder->getUserFolder($user->getUID());
+ $nodes = $userFolder->getById((int)$context['itemId']);
if(count($nodes) === 0) {
return;
}
diff --git a/lib/private/Collaboration/AutoComplete/Manager.php b/lib/private/Collaboration/AutoComplete/Manager.php
index f801ea23338..eedc4fb5b40 100644
--- a/lib/private/Collaboration/AutoComplete/Manager.php
+++ b/lib/private/Collaboration/AutoComplete/Manager.php
@@ -54,7 +54,7 @@ class Manager implements IManager {
}
public function registerSorter($className) {
- $sorters[] = $className;
+ $this->sorters[] = $className;
}
protected function getSorters() {