From 5274c5426818270460ce05ee0071aa9f189281e6 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 29 Oct 2019 12:22:15 +0100 Subject: Add a transfer ownership background job This job can be initiated by a user to transfer a file/folder to a target user. The target user will have to accept the job. Once that is done the transfers is initiated in the background. Both parties get notified when the job is done. Signed-off-by: Roeland Jago Douma --- apps/files/lib/AppInfo/Application.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'apps/files/lib/AppInfo') diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php index 1ffd5e96471..f4897d08e54 100644 --- a/apps/files/lib/AppInfo/Application.php +++ b/apps/files/lib/AppInfo/Application.php @@ -35,6 +35,7 @@ use OCA\Files\Controller\ApiController; use OCA\Files\Controller\ViewController; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files\Listener\LegacyLoadAdditionalScriptsAdapter; +use OCA\Files\Notification\Notifier; use OCA\Files\Service\TagService; use OCP\AppFramework\App; use OCP\Collaboration\Resources\IManager; @@ -42,8 +43,11 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\IContainer; class Application extends App { + + public const APP_ID = 'files'; + public function __construct(array $urlParams=array()) { - parent::__construct('files', $urlParams); + parent::__construct(self::APP_ID, $urlParams); $container = $this->getContainer(); $server = $container->getServer(); @@ -71,7 +75,7 @@ class Application extends App { return new TagService( $c->query('ServerContainer')->getUserSession(), $c->query('ServerContainer')->getActivityManager(), - $c->query('ServerContainer')->getTagManager()->load('files'), + $c->query('ServerContainer')->getTagManager()->load(self::APP_ID), $homeFolder, $server->getEventDispatcher() ); @@ -93,5 +97,9 @@ class Application extends App { /** @var IEventDispatcher $dispatcher */ $dispatcher = $container->query(IEventDispatcher::class); $dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LegacyLoadAdditionalScriptsAdapter::class); + + /** @var \OCP\Notification\IManager $notifications */ + $notifications = $container->query(\OCP\Notification\IManager::class); + $notifications->registerNotifierService(Notifier::class); } } -- cgit v1.2.3