diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-12-05 14:15:32 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-12-06 16:10:30 +0100 |
commit | ab2b3d2755e0b1d54bac84f842426b0b8d3aa006 (patch) | |
tree | cf222bd27de5257f893e60b4db2fd1b224dd14f0 /apps/federatedfilesharing/lib | |
parent | 4fff033c123c7f1fc761547957e9869180c5d8db (diff) | |
download | nextcloud-server-ab2b3d2755e0b1d54bac84f842426b0b8d3aa006.tar.gz nextcloud-server-ab2b3d2755e0b1d54bac84f842426b0b8d3aa006.zip |
Fix external sharing loading script
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/federatedfilesharing/lib')
-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(); } |