|
|
|
|
@ -22,11 +22,12 @@ |
|
|
|
|
namespace OCA\DAV\Comments; |
|
|
|
|
|
|
|
|
|
use OCP\Comments\ICommentsManager; |
|
|
|
|
use OCP\Files\Folder; |
|
|
|
|
use OCP\Comments\NotFoundException; |
|
|
|
|
use OCP\ILogger; |
|
|
|
|
use OCP\IUserManager; |
|
|
|
|
use OCP\IUserSession; |
|
|
|
|
use Sabre\DAV\Exception\NotFound; |
|
|
|
|
use Sabre\DAV\IProperties; |
|
|
|
|
use Sabre\DAV\PropPatch; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -37,12 +38,9 @@ use Sabre\DAV\PropPatch; |
|
|
|
|
* |
|
|
|
|
* @package OCA\DAV\Comments |
|
|
|
|
*/ |
|
|
|
|
class EntityCollection extends RootCollection implements \Sabre\DAV\IProperties { |
|
|
|
|
class EntityCollection extends RootCollection implements IProperties { |
|
|
|
|
const PROPERTY_NAME_READ_MARKER = '{http://owncloud.org/ns}readMarker'; |
|
|
|
|
|
|
|
|
|
/** @var Folder */ |
|
|
|
|
protected $fileRoot; |
|
|
|
|
|
|
|
|
|
/** @var string */ |
|
|
|
|
protected $id; |
|
|
|
|
|
|
|
|
|
@ -53,7 +51,6 @@ class EntityCollection extends RootCollection implements \Sabre\DAV\IProperties |
|
|
|
|
* @param string $id |
|
|
|
|
* @param string $name |
|
|
|
|
* @param ICommentsManager $commentsManager |
|
|
|
|
* @param Folder $fileRoot |
|
|
|
|
* @param IUserManager $userManager |
|
|
|
|
* @param IUserSession $userSession |
|
|
|
|
* @param ILogger $logger |
|
|
|
|
@ -62,7 +59,6 @@ class EntityCollection extends RootCollection implements \Sabre\DAV\IProperties |
|
|
|
|
$id, |
|
|
|
|
$name, |
|
|
|
|
ICommentsManager $commentsManager, |
|
|
|
|
Folder $fileRoot, |
|
|
|
|
IUserManager $userManager, |
|
|
|
|
IUserSession $userSession, |
|
|
|
|
ILogger $logger |
|
|
|
|
@ -76,7 +72,6 @@ class EntityCollection extends RootCollection implements \Sabre\DAV\IProperties |
|
|
|
|
$this->id = $id; |
|
|
|
|
$this->name = $name; |
|
|
|
|
$this->commentsManager = $commentsManager; |
|
|
|
|
$this->fileRoot = $fileRoot; |
|
|
|
|
$this->logger = $logger; |
|
|
|
|
$this->userManager = $userManager; |
|
|
|
|
$this->userSession = $userSession; |
|
|
|
|
@ -111,7 +106,7 @@ class EntityCollection extends RootCollection implements \Sabre\DAV\IProperties |
|
|
|
|
$this->userSession, |
|
|
|
|
$this->logger |
|
|
|
|
); |
|
|
|
|
} catch (\OCP\Comments\NotFoundException $e) { |
|
|
|
|
} catch (NotFoundException $e) { |
|
|
|
|
throw new NotFound(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -159,7 +154,7 @@ class EntityCollection extends RootCollection implements \Sabre\DAV\IProperties |
|
|
|
|
try { |
|
|
|
|
$this->commentsManager->get($name); |
|
|
|
|
return true; |
|
|
|
|
} catch (\OCP\Comments\NotFoundException $e) { |
|
|
|
|
} catch (NotFoundException $e) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|