@@ -159,6 +159,11 @@ private function formatShare(IShare $share): array {
159159 $ result = array_merge ($ result , $ this ->getDeckShareHelper ()->formatShare ($ share ));
160160 } catch (QueryException $ e ) {
161161 }
162+ } elseif ($ share ->getShareType () === IShare::TYPE_CIRCLE ) {
163+ try {
164+ $ result = array_merge ($ result , $ this ->getCirclesShareHelper ()->formatShare ($ share ));
165+ } catch (QueryException $ e ) {
166+ }
162167 }
163168
164169 return $ result ;
@@ -171,8 +176,9 @@ public function index(): DataResponse {
171176 $ groupShares = $ this ->shareManager ->getDeletedSharedWith ($ this ->userId , IShare::TYPE_GROUP , null , -1 , 0 );
172177 $ roomShares = $ this ->shareManager ->getDeletedSharedWith ($ this ->userId , IShare::TYPE_ROOM , null , -1 , 0 );
173178 $ deckShares = $ this ->shareManager ->getDeletedSharedWith ($ this ->userId , IShare::TYPE_DECK , null , -1 , 0 );
179+ $ circlesShares = $ this ->shareManager ->getDeletedSharedWith ($ this ->userId , IShare::TYPE_CIRCLE , null , -1 , 0 );
174180
175- $ shares = array_merge ($ groupShares , $ roomShares , $ deckShares );
181+ $ shares = array_merge ($ groupShares , $ roomShares , $ deckShares, $ circlesShares );
176182
177183 $ shares = array_map (function (IShare $ share ) {
178184 return $ this ->formatShare ($ share );
@@ -239,4 +245,21 @@ private function getDeckShareHelper() {
239245
240246 return $ this ->serverContainer ->get ('\OCA\Deck\Sharing\ShareAPIHelper ' );
241247 }
248+
249+ /**
250+ * Returns the helper of ShareAPIHelper for circles shares.
251+ *
252+ * If the Circles application is not enabled or the helper is not available
253+ * a QueryException is thrown instead.
254+ *
255+ * @return \OCA\Circles\ShareAPIHelper
256+ * @throws QueryException
257+ */
258+ private function getCirclesShareHelper () {
259+ if (!$ this ->appManager ->isEnabledForUser ('circles ' )) {
260+ throw new QueryException ();
261+ }
262+
263+ return $ this ->serverContainer ->get ('\OCA\Circles\ShareByCircleProvider ' );
264+ }
242265}
0 commit comments