Skip to content

Commit 2eb883c

Browse files
committed
fix: show team names in activity feed
Signed-off-by: grnd-alt <git@belakkaf.net>
1 parent a33d36b commit 2eb883c

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

lib/Activity/DeckProvider.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use OCA\Deck\Db\Acl;
1111
use OCA\Deck\Service\CardService;
12+
use OCA\Deck\Service\CirclesService;
1213
use OCP\Activity\IEvent;
1314
use OCP\Activity\IProvider;
1415
use 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

Comments
 (0)