зеркало из 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 OCP\Activity\IEvent;
|
||||
use OCP\Activity\IEventMerger;
|
||||
use OCP\Activity\IProvider;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IL10N;
|
||||
|
@ -40,6 +41,9 @@ class Provider implements IProvider {
|
|||
/** @var FormMapper */
|
||||
private $formMapper;
|
||||
|
||||
/** @var IEventMerger */
|
||||
private $eventMerger;
|
||||
|
||||
/** @var IGroupManager */
|
||||
private $groupManager;
|
||||
|
||||
|
@ -57,6 +61,7 @@ class Provider implements IProvider {
|
|||
|
||||
public function __construct(string $appName,
|
||||
FormMapper $formMapper,
|
||||
IEventMerger $eventMerger,
|
||||
IGroupManager $groupManager,
|
||||
IL10N $l10n,
|
||||
ILogger $logger,
|
||||
|
@ -64,6 +69,7 @@ class Provider implements IProvider {
|
|||
IUserManager $userManager) {
|
||||
$this->appName = $appName;
|
||||
$this->formMapper = $formMapper;
|
||||
$this->eventMerger = $eventMerger;
|
||||
$this->groupManager = $groupManager;
|
||||
$this->l10n = $l10n;
|
||||
$this->logger = $logger;
|
||||
|
@ -92,6 +98,11 @@ class Provider implements IProvider {
|
|||
$event->setRichSubject($subjectString, $parameters);
|
||||
$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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче