зеркало из https://github.com/nextcloud/forms.git
Merge Submission Activities
Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
This commit is contained in:
Родитель
79e6948b87
Коммит
f490c77ccd
|
@ -27,6 +27,7 @@ use Exception;
|
||||||
|
|
||||||
use OCA\Forms\Db\FormMapper;
|
use OCA\Forms\Db\FormMapper;
|
||||||
use OCP\Activity\IEvent;
|
use OCP\Activity\IEvent;
|
||||||
|
use OCP\Activity\IEventMerger;
|
||||||
use OCP\Activity\IProvider;
|
use OCP\Activity\IProvider;
|
||||||
use OCP\IGroupManager;
|
use OCP\IGroupManager;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
|
@ -40,6 +41,9 @@ class Provider implements IProvider {
|
||||||
/** @var FormMapper */
|
/** @var FormMapper */
|
||||||
private $formMapper;
|
private $formMapper;
|
||||||
|
|
||||||
|
/** @var IEventMerger */
|
||||||
|
private $eventMerger;
|
||||||
|
|
||||||
/** @var IGroupManager */
|
/** @var IGroupManager */
|
||||||
private $groupManager;
|
private $groupManager;
|
||||||
|
|
||||||
|
@ -57,6 +61,7 @@ class Provider implements IProvider {
|
||||||
|
|
||||||
public function __construct(string $appName,
|
public function __construct(string $appName,
|
||||||
FormMapper $formMapper,
|
FormMapper $formMapper,
|
||||||
|
IEventMerger $eventMerger,
|
||||||
IGroupManager $groupManager,
|
IGroupManager $groupManager,
|
||||||
IL10N $l10n,
|
IL10N $l10n,
|
||||||
ILogger $logger,
|
ILogger $logger,
|
||||||
|
@ -64,6 +69,7 @@ class Provider implements IProvider {
|
||||||
IUserManager $userManager) {
|
IUserManager $userManager) {
|
||||||
$this->appName = $appName;
|
$this->appName = $appName;
|
||||||
$this->formMapper = $formMapper;
|
$this->formMapper = $formMapper;
|
||||||
|
$this->eventMerger = $eventMerger;
|
||||||
$this->groupManager = $groupManager;
|
$this->groupManager = $groupManager;
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $l10n;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
|
@ -92,6 +98,11 @@ class Provider implements IProvider {
|
||||||
$event->setRichSubject($subjectString, $parameters);
|
$event->setRichSubject($subjectString, $parameters);
|
||||||
$event->setIcon($this->getEventIcon($event->getSubject()));
|
$event->setIcon($this->getEventIcon($event->getSubject()));
|
||||||
|
|
||||||
|
// For Subject NewShare, merge by users
|
||||||
|
if ($event->getSubject() === ActivityConstants::SUBJECT_NEWSUBMISSION) {
|
||||||
|
$event = $this->eventMerger->mergeEvents('user', $event, $previousEvent);
|
||||||
|
}
|
||||||
|
|
||||||
return $event;
|
return $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче