Skip to content

Commit

Permalink
Do not create a new version if previousNode has the same mtime
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge authored and backportbot-nextcloud[bot] committed Jun 23, 2023
1 parent 9250b91 commit 3961a39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/files_versions/lib/Listener/FileEventsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ public function post_write_hook(Node $node): void {
}

if (
($writeHookInfo['versionCreated'] && $node->getMTime() !== $writeHookInfo['previousNode']->getMTime()) ||
$writeHookInfo['previousNode']->getSize() === 0
($writeHookInfo['versionCreated'] || $writeHookInfo['previousNode']->getSize() === 0) &&
$node->getMTime() !== $writeHookInfo['previousNode']->getMTime()
) {
// If a new version was created, insert a version in the DB for the current content.
// Unless both versions have the same mtime.
Expand Down

0 comments on commit 3961a39

Please sign in to comment.