99
1010use OCA \Deck \Db \Acl ;
1111use OCA \Deck \Service \CardService ;
12+ use OCA \Deck \Service \CirclesService ;
1213use OCP \Activity \IEvent ;
1314use OCP \Activity \IProvider ;
1415use OCP \Comments \IComment ;
@@ -38,7 +39,10 @@ class DeckProvider implements IProvider {
3839 /** @var CardService */
3940 private $ cardService ;
4041
41- public function __construct (IURLGenerator $ urlGenerator , ActivityManager $ activityManager , IUserManager $ userManager , ICommentsManager $ commentsManager , IFactory $ l10n , IConfig $ config , $ userId , CardService $ cardService ) {
42+ /** @var CirclesService */
43+ private $ circlesService ;
44+
45+ public function __construct (IURLGenerator $ urlGenerator , ActivityManager $ activityManager , IUserManager $ userManager , ICommentsManager $ commentsManager , IFactory $ l10n , IConfig $ config , $ userId , CardService $ cardService , CirclesService $ circlesService ) {
4246 $ this ->userId = $ userId ;
4347 $ this ->urlGenerator = $ urlGenerator ;
4448 $ this ->activityManager = $ activityManager ;
@@ -47,6 +51,7 @@ public function __construct(IURLGenerator $urlGenerator, ActivityManager $activi
4751 $ this ->l10nFactory = $ l10n ;
4852 $ this ->config = $ config ;
4953 $ this ->cardService = $ cardService ;
54+ $ this ->circlesService = $ circlesService ;
5055 }
5156
5257 /**
@@ -275,7 +280,15 @@ private function parseParamForAcl($subjectParams, $params) {
275280 'id ' => $ subjectParams ['acl ' ]['participant ' ],
276281 'name ' => $ user !== null ? $ user ->getDisplayName () : $ subjectParams ['acl ' ]['participant ' ]
277282 ];
278- } else {
283+ } else if ($ subjectParams ['acl ' ]['type ' ] === Acl::PERMISSION_TYPE_CIRCLE ) {
284+ $ circle = $ this ->circlesService ->getCircle ($ subjectParams ['acl ' ]['participant ' ]);
285+ $ params ['acl ' ] = [
286+ 'type ' => 'highlight ' ,
287+ 'id ' => $ subjectParams ['acl ' ]['participant ' ],
288+ 'name ' => $ circle !== null ? $ circle ->getName () : $ subjectParams ['acl ' ]['participant ' ]
289+ ];
290+ }
291+ else {
279292 $ params ['acl ' ] = [
280293 'type ' => 'highlight ' ,
281294 'id ' => (string )$ subjectParams ['acl ' ]['participant ' ],
0 commit comments