Skip to content

Commit

Permalink
Merge pull request #2751 from nextcloud/bugfix/noid/cron-activity-author
Browse files Browse the repository at this point in the history
Properly set author for activity events that are triggered by cron
  • Loading branch information
juliusknorr authored Jan 27, 2021
2 parents c32357f + 147a402 commit 2f1dfad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Activity/ActivityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,12 @@ private function createEvent($objectType, $entity, $subject, $additionalParams =
unset($additionalParams['after'], $additionalParams['before']);
}

$subjectParams['author'] = $this->userId;

$subjectParams['author'] = $author === null ? $this->userId : $author;

$event = $this->manager->generateEvent();
$event->setApp('deck')
->setType($eventType)
->setAuthor($author === null ? $this->userId : $author)
->setAuthor($subjectParams['author'])
->setObject($objectType, (int)$object->getId(), $object->getTitle())
->setSubject($subject, array_merge($subjectParams, $additionalParams))
->setTimestamp(time());
Expand Down

0 comments on commit 2f1dfad

Please sign in to comment.