diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-14 19:58:19 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-14 19:58:19 +0200 |
commit | 39bb9c06d165af8b39ba2c3cdcd8d4f9727e6afd (patch) | |
tree | b4e48501e96444302381fbb79971991bb153a1ab /lib/private/Preview/Watcher.php | |
parent | 0dcb6b267524b645d3e058b935bf8f6b31bf1f56 (diff) | |
download | nextcloud-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/Watcher.php')
-rw-r--r-- | lib/private/Preview/Watcher.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/Preview/Watcher.php b/lib/private/Preview/Watcher.php index be462d9c935..0c0531dff94 100644 --- a/lib/private/Preview/Watcher.php +++ b/lib/private/Preview/Watcher.php @@ -49,6 +49,10 @@ class Watcher { } public function postWrite(Node $node) { + $this->deleteNode($node); + } + + protected function deleteNode(Node $node) { // We only handle files if ($node instanceof Folder) { return; @@ -61,4 +65,10 @@ class Watcher { //Nothing to do } } + + public function versionRollback(array $data) { + if (isset($data['node'])) { + $this->deleteNode($data['node']); + } + } } |