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

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2019-04-02 02:13:01 +0300
committerPhie <phie@phie.ovh>2019-04-02 02:13:01 +0300
commitaaba3699caf1cb8dfb395dfc13720ee029e454de (patch)
tree6f2a514f21444b1cb150faca744090c1f4d86c86 /appinfo
parentbf4ed375f3ea6e5efd6668e4c1d3a041dcd9be2f (diff)
cache is back in a secured way + delete from cache when a note is deleted
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/app.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
index d1228b2..39b15ca 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -47,15 +47,23 @@ class Application extends App {
private function connectWatcher(IAppContainer $container) {
/** @var IRootFolder $root */
- /*$root = $container->query(IRootFolder::class);
- $root->listen('\OC\Files', 'postWrite', function (Node $node) use ($container) {
- $c = $container->query('ServerContainer');
+ $root = $container->query(IRootFolder::class);
+ $root->listen('\OC\Files', 'postWrite', function (Node $node) use ($container) {
+ $c = $container->query('ServerContainer');
$user = $c->getUserSession()->getUser();
if($user != null){
$watcher = new FSHooks($c->getUserFolder(), $user->getUID(), $c->getConfig(), 'carnet',$container->query(IDBConnection::class));
$watcher->postWrite($node);
}
- });*/
+ });
+ $root->listen('\OC\Files', 'postDelete', function (Node $node) use ($container) {
+ $c = $container->query('ServerContainer');
+ $user = $c->getUserSession()->getUser();
+ if($user != null){
+ $watcher = new FSHooks($c->getUserFolder(), $user->getUID(), $c->getConfig(), 'carnet',$container->query(IDBConnection::class));
+ $watcher->postDelete($node);
+ }
+ });
}
}
$app = new Application();