]> source.dussan.org Git - nextcloud-server.git/commitdiff
Hookup the etag propagator
authorRobin Appelman <icewind@owncloud.com>
Mon, 29 Sep 2014 11:46:27 +0000 (13:46 +0200)
committerVincent Petry <pvince81@owncloud.com>
Wed, 8 Oct 2014 12:22:17 +0000 (14:22 +0200)
apps/files_external/lib/config.php
apps/files_external/lib/etagpropagator.php

index 604700ccf571d107d6d798cf7156e15fae0a1c96..92bb891ca21b032be309fc82546f6984ffa7cee6 100755 (executable)
@@ -118,6 +118,22 @@ class OC_Mount_Config {
                        }
                        $manager->addMount($mount);
                }
+
+               if ($data['user']) {
+                       $user = \OC::$server->getUserManager()->get($data['user']);
+                       $userView = new \OC\Files\View('/' . $user->getUID() . '/files');
+                       $changePropagator = new \OC\Files\Cache\ChangePropagator($userView);
+                       $etagPropagator = new \OCA\Files_External\EtagPropagator($user, $changePropagator, \OC::$server->getConfig());
+                       $etagPropagator->propagateDirtyMountPoints();
+                       \OCP\Util::connectHook(
+                               \OC\Files\Filesystem::CLASSNAME,
+                               \OC\Files\Filesystem::signal_create_mount,
+                               $etagPropagator, 'updateHook');
+                       \OCP\Util::connectHook(
+                               \OC\Files\Filesystem::CLASSNAME,
+                               \OC\Files\Filesystem::signal_delete_mount,
+                               $etagPropagator, 'updateHook');
+               }
        }
 
        /**
index 00571657504ce833ab79d0e5dc92659b6cdc5b8f..35bf8328cad8f7eb23ba492769c5cafb3452b500 100644 (file)
@@ -97,6 +97,7 @@ class EtagPropagator {
                $users = $params[Filesystem::signal_param_users];
                $type = $params[Filesystem::signal_param_mount_type];
                $mountPoint = $params[Filesystem::signal_param_path];
+               $mountPoint = Filesystem::normalizePath($mountPoint);
                if ($type === \OC_Mount_Config::MOUNT_TYPE_GROUP or $users === 'all') {
                        $this->markDirty($mountPoint, $time);
                } else {