mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 18:21:40 -04:00
chore(shares): remove useless method
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
parent
2606f7b7dd
commit
f91f4cee1c
1 changed files with 1 additions and 45 deletions
|
|
@ -870,7 +870,7 @@ class ShareAPIController extends OCSController {
|
|||
|
||||
/** @var IShare[] $shares */
|
||||
$shares = array_reduce($nodes, function ($carry, $node) {
|
||||
$carry = array_merge($carry, $this->getAllShares($node, true));
|
||||
$carry = array_merge($carry, $this->getSharesFromNode($this->userId, $node, true));
|
||||
return $carry;
|
||||
}, []);
|
||||
|
||||
|
|
@ -1995,50 +1995,6 @@ class ShareAPIController extends OCSController {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the shares for the current user
|
||||
*
|
||||
* @param Node|null $path
|
||||
* @param boolean $reshares
|
||||
* @return IShare[]
|
||||
*/
|
||||
private function getAllShares(?Node $path = null, bool $reshares = false) {
|
||||
// Get all shares
|
||||
$userShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_USER, $path, $reshares, -1, 0);
|
||||
$groupShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_GROUP, $path, $reshares, -1, 0);
|
||||
$linkShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_LINK, $path, $reshares, -1, 0);
|
||||
|
||||
// EMAIL SHARES
|
||||
$mailShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_EMAIL, $path, $reshares, -1, 0);
|
||||
|
||||
// TEAM SHARES
|
||||
$circleShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_CIRCLE, $path, $reshares, -1, 0);
|
||||
|
||||
// TALK SHARES
|
||||
$roomShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_ROOM, $path, $reshares, -1, 0);
|
||||
|
||||
// DECK SHARES
|
||||
$deckShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_DECK, $path, $reshares, -1, 0);
|
||||
|
||||
// SCIENCEMESH SHARES
|
||||
$sciencemeshShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_SCIENCEMESH, $path, $reshares, -1, 0);
|
||||
|
||||
// FEDERATION
|
||||
if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
|
||||
$federatedShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_REMOTE, $path, $reshares, -1, 0);
|
||||
} else {
|
||||
$federatedShares = [];
|
||||
}
|
||||
if ($this->shareManager->outgoingServer2ServerGroupSharesAllowed()) {
|
||||
$federatedGroupShares = $this->shareManager->getSharesBy($this->userId, IShare::TYPE_REMOTE_GROUP, $path, $reshares, -1, 0);
|
||||
} else {
|
||||
$federatedGroupShares = [];
|
||||
}
|
||||
|
||||
return array_merge($userShares, $groupShares, $linkShares, $mailShares, $circleShares, $roomShares, $deckShares, $sciencemeshShares, $federatedShares, $federatedGroupShares);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* merging already formatted shares.
|
||||
* We'll make an associative array to easily detect duplicate Ids.
|
||||
|
|
|
|||
Loading…
Reference in a new issue