summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview/WatcherConnector.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-05-14 19:58:19 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-14 19:58:19 +0200
commit39bb9c06d165af8b39ba2c3cdcd8d4f9727e6afd (patch)
treeb4e48501e96444302381fbb79971991bb153a1ab /lib/private/Preview/WatcherConnector.php
parent0dcb6b267524b645d3e058b935bf8f6b31bf1f56 (diff)
downloadnextcloud-server-39bb9c06d165af8b39ba2c3cdcd8d4f9727e6afd.tar.gz
nextcloud-server-39bb9c06d165af8b39ba2c3cdcd8d4f9727e6afd.zip
Delete the previews when a version is restored
Fixes #9469 When a version of a file is restored the previews are no longer valid. Thus we should remove them so they are regenerated. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Preview/WatcherConnector.php')
-rw-r--r--lib/private/Preview/WatcherConnector.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/Preview/WatcherConnector.php b/lib/private/Preview/WatcherConnector.php
index bf9e6c29e4f..f374b909d8f 100644
--- a/lib/private/Preview/WatcherConnector.php
+++ b/lib/private/Preview/WatcherConnector.php
@@ -60,6 +60,8 @@ class WatcherConnector {
$this->root->listen('\OC\Files', 'postWrite', function (Node $node) {
$this->getWatcher()->postWrite($node);
});
+
+ \OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback');
}
}
}