Fix DI of the cloud id manager into apps

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-02-14 12:47:46 +01:00
parent 7113af3f91
commit 0be2921966
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
3 changed files with 7 additions and 1 deletions

View File

@ -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') {

View File

@ -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();
});

View File

@ -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 @