Skip to content

Commit 6f189cc

Browse files
committed
chore: adjust for legacy Nextcloud 29 and before (use OCA instead of OCP)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent e0a566c commit 6f189cc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

apps/dav/lib/Connector/Sabre/SharesPlugin.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
use OC\Share20\Exception\BackendError;
3232
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
3333
use OCA\DAV\Connector\Sabre\Node as DavNode;
34+
use OCA\Files_Sharing\ISharedStorage;
35+
use OCA\Files_Sharing\SharedStorage;
3436
use OCP\Files\Folder;
3537
use OCP\Files\Node;
3638
use OCP\Files\NotFoundException;
37-
use OCP\Files\Storage\ISharedStorage;
3839
use OCP\IUserSession;
3940
use OCP\Share\IManager;
4041
use OCP\Share\IShare;
@@ -91,9 +92,9 @@ public function initialize(Server $server) {
9192
$server->protectedProperties[] = self::SHAREES_PROPERTYNAME;
9293

9394
$this->server = $server;
94-
$this->server->on('propFind', $this->handleGetProperties(...));
95-
$this->server->on('beforeCopy', $this->validateMoveOrCopy(...));
96-
$this->server->on('beforeMove', $this->validateMoveOrCopy(...));
95+
$this->server->on('propFind', [$this, 'handleGetProperties']);
96+
$this->server->on('beforeCopy', [$this, 'validateMoveOrCopy']);
97+
$this->server->on('beforeMove', [$this, 'validateMoveOrCopy']);
9798
}
9899

99100
/**
@@ -264,7 +265,7 @@ public function validateMoveOrCopy(string $source, string $target): bool {
264265
if ($sourceStorage->instanceOfStorage(ISharedStorage::class)) {
265266
// source is also a share - check if it is the same share
266267

267-
/** @var ISharedStorage $sourceStorage */
268+
/** @var SharedStorage $sourceStorage */
268269
$sourceShare = $sourceStorage->getShare();
269270
foreach ($targetShares as $targetShare) {
270271
if ($targetShare->getId() === $sourceShare->getId()) {

0 commit comments

Comments
 (0)