diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Collaboration/Collaborators/Search.php | 9 | ||||
-rw-r--r-- | lib/private/Server.php | 15 |
2 files changed, 16 insertions, 8 deletions
diff --git a/lib/private/Collaboration/Collaborators/Search.php b/lib/private/Collaboration/Collaborators/Search.php index 5a17a3fb653..e9b15dd1201 100644 --- a/lib/private/Collaboration/Collaborators/Search.php +++ b/lib/private/Collaboration/Collaborators/Search.php @@ -34,12 +34,7 @@ class Search implements ISearch { /** @var IContainer */ private $c; - protected $pluginList = [ - Share::SHARE_TYPE_USER => [UserPlugin::class], - Share::SHARE_TYPE_GROUP => [GroupPlugin::class], - Share::SHARE_TYPE_EMAIL => [MailPlugin::class], - Share::SHARE_TYPE_REMOTE => [RemotePlugin::class], - ]; + protected $pluginList = []; public function __construct(IContainer $c) { $this->c = $c; @@ -81,7 +76,7 @@ class Search implements ISearch { $searchResult->unsetResult($emailType); } - return [$searchResult->asArray(), $hasMoreResults]; + return [$searchResult->asArray(), (bool)$hasMoreResults]; } public function registerPlugin(array $pluginInfo) { diff --git a/lib/private/Server.php b/lib/private/Server.php index 88fc79e472e..29aee06d896 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -52,6 +52,10 @@ use OC\AppFramework\Http\Request; use OC\AppFramework\Utility\SimpleContainer; use OC\AppFramework\Utility\TimeFactory; use OC\Authentication\LoginCredentials\Store; +use OC\Collaboration\Collaborators\GroupPlugin; +use OC\Collaboration\Collaborators\MailPlugin; +use OC\Collaboration\Collaborators\RemotePlugin; +use OC\Collaboration\Collaborators\UserPlugin; use OC\Command\CronBus; use OC\Contacts\ContactsMenu\ActionFactory; use OC\Diagnostics\EventLogger; @@ -115,6 +119,7 @@ use OCP\Contacts\ContactsMenu\IActionFactory; use OCP\Lock\ILockingProvider; use OCP\RichObjectStrings\IValidator; use OCP\Security\IContentSecurityPolicyManager; +use OCP\Share; use OCP\Share\IShareHelper; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -994,7 +999,15 @@ class Server extends ServerContainer implements IServerContainer { $this->registerAlias('ShareManager', \OCP\Share\IManager::class); $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) { - return new Collaboration\Collaborators\Search($c); + $instance = new Collaboration\Collaborators\Search($c); + + // register default plugins + $instance->registerPlugin(['shareType' => 'SHARE_TYPE_USER', 'class' => UserPlugin::class]); + $instance->registerPlugin(['shareType' => 'SHARE_TYPE_GROUP', 'class' => GroupPlugin::class]); + $instance->registerPlugin(['shareType' => 'SHARE_TYPE_EMAIL', 'class' => MailPlugin::class]); + $instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE', 'class' => RemotePlugin::class]); + + return $instance; }); $this->registerAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class); |