Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-12-05 16:15:32 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-12-06 18:10:30 +0300
commitab2b3d2755e0b1d54bac84f842426b0b8d3aa006 (patch)
treecf222bd27de5257f893e60b4db2fd1b224dd14f0 /apps/federatedfilesharing/lib
parent4fff033c123c7f1fc761547957e9869180c5d8db (diff)
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.php21
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();
}