summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-02-14 17:42:53 -0600
committerGitHub <noreply@github.com>2017-02-14 17:42:53 -0600
commitb5b541d084de4d9339349100ebacc85a67973a9c (patch)
tree9a93a599fbc2b2524ade29189bd92ffd9d9a8151
parent9f74858537377d1aae6cf8b7530c9faa987cf8ff (diff)
parent0be292196657bb6d525214d7f6832029bde189cd (diff)
downloadnextcloud-server-b5b541d084de4d9339349100ebacc85a67973a9c.tar.gz
nextcloud-server-b5b541d084de4d9339349100ebacc85a67973a9c.zip
Merge pull request #3477 from nextcloud/fix-cloud-id-manager-injection
Fix DI of the cloud id manager into apps
-rw-r--r--apps/federatedfilesharing/lib/Notifier.php2
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php5
-rw-r--r--lib/private/Federation/CloudIdManager.php1
3 files changed, 7 insertions, 1 deletions
diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php
index faf79480b7e..2b7c9f78a75 100644
--- a/apps/federatedfilesharing/lib/Notifier.php
+++ b/apps/federatedfilesharing/lib/Notifier.php
@@ -25,7 +25,6 @@ namespace OCA\FederatedFileSharing;
use OC\HintException;
-use OC\Share\Helper;
use OCP\Contacts\IManager;
use OCP\Federation\ICloudId;
use OCP\Federation\ICloudIdManager;
@@ -63,6 +62,7 @@ class Notifier implements INotifier {
* @param INotification $notification
* @param string $languageCode The code of the language that should be used to prepare the notification
* @return INotification
+ * @throws \InvalidArgumentException
*/
public function prepare(INotification $notification, $languageCode) {
if ($notification->getApp() !== 'files_sharing') {
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 5a350bbec5a..ec36aab75d9 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -49,6 +49,7 @@ use OC\RichObjectStrings\Validator;
use OC\Security\Bruteforce\Throttler;
use OCP\AppFramework\IApi;
use OCP\AppFramework\IAppContainer;
+use OCP\Federation\ICloudIdManager;
use OCP\Files\IAppData;
use OCP\Files\Mount\IMountManager;
use OCP\RichObjectStrings\IValidator;
@@ -152,6 +153,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getQueryLogger();
});
+ $this->registerService(ICloudIdManager::class, function($c) {
+ return $this->getServer()->getCloudIdManager();
+ });
+
$this->registerService('OCP\\Files\\IMimeTypeDetector', function($c) {
return $this->getServer()->getMimeTypeDetector();
});
diff --git a/lib/private/Federation/CloudIdManager.php b/lib/private/Federation/CloudIdManager.php
index 45cc69b306e..46d90f7ab92 100644
--- a/lib/private/Federation/CloudIdManager.php
+++ b/lib/private/Federation/CloudIdManager.php
@@ -27,6 +27,7 @@ class CloudIdManager implements ICloudIdManager {
/**
* @param string $cloudId
* @return ICloudId
+ * @throws \InvalidArgumentException
*/
public function resolveCloudId($cloudId) {
// TODO magic here to get the url and user instead of just splitting on @