@@ -20,7 +20,7 @@ class FileSharingTeamResourceProvider implements ITeamResourceProvider {
2020 public function __construct (
2121 private IL10N $ l10n ,
2222 private ?CirclesManager $ circlesManager ,
23- private ShareWrapperService $ shareByCircleProvider ,
23+ private ShareWrapperService $ shareWrapperService ,
2424 private IURLGenerator $ urlGenerator ,
2525 ) {
2626 }
@@ -42,24 +42,20 @@ public function getSharedWith(string $teamId): array {
4242 return [];
4343 }
4444
45- $ shares = $ this ->shareByCircleProvider ->getSharesToCircle ($ teamId );
45+ $ shares = $ this ->shareWrapperService ->getSharesToCircle ($ teamId );
4646 return $ this ->convertWrappedShareToResource ($ shares );
4747 }
4848
4949 /**
5050 * @return array<string, TeamResource[]>
5151 */
52- public function getSharedWithList (array $ teams ): array {
53- $ data = $ shares = [];
54- foreach ($ this ->shareByCircleProvider ->getSharesToCircles ($ teams ) as $ share ) {
55- if (!array_key_exists ($ share ->getId (), $ shares )) {
56- $ shares [$ share ->getSharedWith ()] = [];
57- }
52+ public function getSharedWithList (array $ teams , string $ resourceId ): array {
53+ $ shares = $ data = [];
54+ foreach ($ this ->shareWrapperService ->getSharesToCircles ($ teams , $ resourceId ) as $ share ) {
5855 $ shares [$ share ->getSharedWith ()][] = $ share ;
5956 }
60-
6157 foreach ($ teams as $ teamId ) {
62- $ data [$ teamId ] = $ this ->convertWrappedShareToResource ($ shares [$ teamId ]);
58+ $ data [$ teamId ] = $ this ->convertWrappedShareToResource ($ shares [$ teamId ] ?? [] );
6359 }
6460
6561 return $ data ;
@@ -105,7 +101,7 @@ public function getTeamsForResource(string $resourceId): array {
105101 return [];
106102 }
107103
108- $ shares = $ this ->shareByCircleProvider ->getSharesByFileId ((int )$ resourceId );
104+ $ shares = $ this ->shareWrapperService ->getSharesByFileId ((int )$ resourceId );
109105
110106 return array_map (function ($ share ) {
111107 return $ share ->getSharedWith ();
0 commit comments