Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: remove share status from share:list as it doesn't seem to conta…
…in usefull info at the moment

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Mar 28, 2025
commit b9723eaa2253663a9f8965dd600a5227e37b83d3
19 changes: 0 additions & 19 deletions apps/files_sharing/lib/Command/ListShares.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ class ListShares extends Base {
IShare::TYPE_DECK => 'deck',
];

private const SHARE_STATUS_NAMES = [
IShare::STATUS_PENDING => 'pending',
IShare::STATUS_ACCEPTED => 'accepted',
IShare::STATUS_REJECTED => 'rejected',
];

public function __construct(
private readonly IManager $shareManager,
private readonly IRootFolder $rootFolder,
Expand Down Expand Up @@ -85,7 +79,6 @@ public function execute(InputInterface $input, OutputInterface $output): int {
'recipient' => $share->getSharedWith(),
'by' => $share->getSharedBy(),
'type' => self::SHARE_TYPE_NAMES[$share->getShareType()] ?? 'unknown',
'status' => self::SHARE_STATUS_NAMES[$share->getStatus()] ?? 'unknown',
];
}, $shares);

Expand Down Expand Up @@ -126,15 +119,6 @@ private function getShareType(string $type): int {
throw new \Exception("Unknown share type $type");
}

private function getShareStatus(string $status): int {
foreach (self::SHARE_STATUS_NAMES as $shareStatus => $shareStatusName) {
if ($shareStatusName === $status) {
return $shareStatus;
}
}
throw new \Exception("Unknown share status $status");
}

private function shouldShowShare(InputInterface $input, IShare $share): bool {
if ($input->getOption('owner') && $share->getShareOwner() !== $input->getOption('owner')) {
return false;
Expand Down Expand Up @@ -172,9 +156,6 @@ private function shouldShowShare(InputInterface $input, IShare $share): bool {
if ($input->getOption('type') && $share->getShareType() !== $this->getShareType($input->getOption('type'))) {
return false;
}
if ($input->getOption('status') && $share->getStatus() !== $this->getShareStatus($input->getOption('status'))) {
return false;
}
return true;
}
}
Loading