-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recover deleted circles shares #35526
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,11 @@ | |
$result = array_merge($result, $this->getDeckShareHelper()->formatShare($share)); | ||
} catch (QueryException $e) { | ||
} | ||
} elseif ($share->getShareType() === IShare::TYPE_CIRCLE) { | ||
try { | ||
$result = array_merge($result, $this->getCirclesShareHelper()->formatShare($share)); | ||
} catch (QueryException $e) { | ||
} | ||
} elseif ($share->getShareType() === IShare::TYPE_SCIENCEMESH) { | ||
$result['share_with'] = $share->getSharedWith(); | ||
$result['share_with_displayname'] = ''; | ||
|
@@ -195,9 +200,10 @@ | |
$groupShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_GROUP, null, -1, 0); | ||
$roomShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_ROOM, null, -1, 0); | ||
$deckShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_DECK, null, -1, 0); | ||
$circlesShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_CIRCLE, null, -1, 0); | ||
$sciencemeshShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_SCIENCEMESH, null, -1, 0); | ||
|
||
$shares = array_merge($groupShares, $roomShares, $deckShares, $sciencemeshShares); | ||
$shares = array_merge($groupShares, $roomShares, $deckShares, $circlesShares, $sciencemeshShares); | ||
|
||
$shares = array_map(function (IShare $share) { | ||
return $this->formatShare($share); | ||
|
@@ -272,6 +278,23 @@ | |
return $this->serverContainer->get('\OCA\Deck\Sharing\ShareAPIHelper'); | ||
} | ||
|
||
/** | ||
* Returns the helper of ShareAPIHelper for circles shares. | ||
* | ||
* If the Circles application is not enabled or the helper is not available | ||
* a QueryException is thrown instead. | ||
* | ||
* @return \OCA\Circles\ShareAPIHelper | ||
Check failure Code scanning / Psalm UndefinedDocblockClass
Docblock-defined class, interface or enum named OCA\Circles\ShareAPIHelper does not exist
|
||
* @throws QueryException | ||
*/ | ||
private function getCirclesShareHelper() { | ||
if (!$this->appManager->isEnabledForUser('circles')) { | ||
throw new QueryException(); | ||
Check notice Code scanning / Psalm DeprecatedClass Note
OCP\AppFramework\QueryException is marked deprecated
|
||
} | ||
|
||
return $this->serverContainer->get('\OCA\Circles\ShareByCircleProvider'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not |
||
} | ||
|
||
/** | ||
* Returns the helper of DeletedShareAPIHelper for sciencemesh shares. | ||
* | ||
|
Check failure
Code scanning / Psalm
UndefinedDocblockClass