diff options
Diffstat (limited to 'apps/federatedfilesharing/lib/AppInfo')
-rw-r--r-- | apps/federatedfilesharing/lib/AppInfo/Application.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/federatedfilesharing/lib/AppInfo/Application.php b/apps/federatedfilesharing/lib/AppInfo/Application.php index 07cd8d1ea3e..c60c62a975f 100644 --- a/apps/federatedfilesharing/lib/AppInfo/Application.php +++ b/apps/federatedfilesharing/lib/AppInfo/Application.php @@ -32,7 +32,7 @@ use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\Controller\RequestHandlerController; use OCA\FederatedFileSharing\FederatedShareProvider; use OCA\FederatedFileSharing\Notifications; -use OCA\FederatedFileSharing\OCM\CloudFederationProvider; +use OCA\FederatedFileSharing\Notifier; use OCA\FederatedFileSharing\OCM\CloudFederationProviderFiles; use OCP\AppFramework\App; use OCP\GlobalScale\IConfig; @@ -99,6 +99,23 @@ class Application extends App { $server->getCloudFederationProviderManager() ); }); + + // register events listeners + $eventDispatcher = $server->getEventDispatcher(); + $manager = $server->getNotificationManager(); + $federatedShareProvider = $this->getFederatedShareProvider(); + + $manager->registerNotifierService(Notifier::class); + + $eventDispatcher->addListener( + 'OCA\Files::loadAdditionalScripts', + function() use ($federatedShareProvider) { + if ($federatedShareProvider->isIncomingServer2serverShareEnabled()) { + \OCP\Util::addScript('federatedfilesharing', 'external'); + } + } + ); + } /** @@ -106,7 +123,7 @@ class Application extends App { * * @return FederatedShareProvider */ - public function getFederatedShareProvider() { + protected function getFederatedShareProvider() { if ($this->federatedShareProvider === null) { $this->initFederatedShareProvider(); } |