Skip to content

Commit 2f1dfad

Browse files
authored
Merge pull request #2751 from nextcloud/bugfix/noid/cron-activity-author
Properly set author for activity events that are triggered by cron
2 parents c32357f + 147a402 commit 2f1dfad

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/Activity/ActivityManager.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,12 @@ private function createEvent($objectType, $entity, $subject, $additionalParams =
405405
unset($additionalParams['after'], $additionalParams['before']);
406406
}
407407

408-
$subjectParams['author'] = $this->userId;
409-
408+
$subjectParams['author'] = $author === null ? $this->userId : $author;
410409

411410
$event = $this->manager->generateEvent();
412411
$event->setApp('deck')
413412
->setType($eventType)
414-
->setAuthor($author === null ? $this->userId : $author)
413+
->setAuthor($subjectParams['author'])
415414
->setObject($objectType, (int)$object->getId(), $object->getTitle())
416415
->setSubject($subject, array_merge($subjectParams, $additionalParams))
417416
->setTimestamp(time());

0 commit comments

Comments
 (0)