Merge pull request #9415 from nextcloud/feature/noid/trashbin_dav_deletion_time

Propfind for deletion time of trash files
pull/9437/head
Morris Jobke 8 years ago committed by GitHub
commit 57ea462474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/files_trashbin/lib/Sabre/ITrash.php
  2. 5
      apps/files_trashbin/lib/Sabre/PropfindPlugin.php
  3. 4
      apps/files_trashbin/lib/Sabre/TrashFile.php
  4. 3
      apps/files_trashbin/lib/Sabre/TrashFolder.php
  5. 4
      apps/files_trashbin/lib/Sabre/TrashFolderFile.php
  6. 4
      apps/files_trashbin/lib/Sabre/TrashFolderFolder.php

@ -29,4 +29,6 @@ interface ITrash {
public function getFilename(): string;
public function getOriginalLocation(): string;
public function getDeletionTime(): int;
}

@ -33,6 +33,7 @@ class PropfindPlugin extends ServerPlugin {
const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename';
const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location';
const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time';
/** @var Server */
private $server;
@ -59,6 +60,10 @@ class PropfindPlugin extends ServerPlugin {
$propFind->handle(self::TRASHBIN_ORIGINAL_LOCATION, function() use ($node) {
return $node->getOriginalLocation();
});
$propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) {
return $node->getDeletionTime();
});
}
}

@ -87,5 +87,7 @@ class TrashFile implements IFile, ITrash {
return $this->data['extraData'];
}
public function getDeletionTime(): int {
return $this->getLastModified();
}
}

@ -116,5 +116,8 @@ class TrashFolder implements ICollection, ITrash {
return $this->data['extraData'];
}
public function getDeletionTime(): int {
return $this->getLastModified();
}
}

@ -98,5 +98,7 @@ class TrashFolderFile implements IFile, ITrash {
return $this->location . '/' . $this->getFilename();
}
public function getDeletionTime(): int {
return $this->getLastModified();
}
}

@ -129,5 +129,7 @@ class TrashFolderFolder implements ICollection, ITrash {
return $this->location . '/' . $this->getFilename();
}
public function getDeletionTime(): int {
return $this->getLastModified();
}
}

Loading…
Cancel
Save