Activity: trigger activity on board share/unshare

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-09-06 21:09:21 +02:00
parent 7e88d246c0
commit f686b1e75b
3 changed files with 46 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ namespace OCA\Deck\Activity;
use cogpowered\FineDiff\Diff;
use OCA\Deck\Db\Acl;
use OCP\Activity\IEvent;
use OCP\Activity\IProvider;
use OCP\IURLGenerator;
@@ -162,7 +163,7 @@ class DeckProvider implements IProvider {
}
if (array_key_exists('assigneduser', $subjectParams)) {
$user = $userManager->get($subjectParams['assigneduser']);
$user = $this->userManager->get($subjectParams['assigneduser']);
$params['assigneduser'] = [
'type' => 'user',
'id' => $subjectParams['assigneduser'],
@@ -170,6 +171,24 @@ class DeckProvider implements IProvider {
];
}
if (array_key_exists('acl', $subjectParams)) {
if ($subjectParams['acl']['type'] === Acl::PERMISSION_TYPE_USER) {
$user = $this->userManager->get($subjectParams['acl']['participant']);
$params['acl'] = [
'type' => 'user',
'id' => $subjectParams['acl']['participant'],
'name' => $user !== null ? $user->getDisplayName() : $subjectParams['acl']['participant']
];
} else {
$params['acl'] = [
'type' => 'highlight',
'id' => $subjectParams['acl']['participant'],
'name' => $subjectParams['acl']['participant']
];
}
}
if (array_key_exists('before', $subjectParams)) {
$params['before'] = [
'type' => 'highlight',