From 147a40203f2e738f2e29e7d93ebab7119d7c5835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 25 Jan 2021 10:51:56 +0100 Subject: [PATCH] Properly set author for activity events that are triggered by cron MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Activity/ActivityManager.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index 11d03c318..20955df33 100644 --- a/lib/Activity/ActivityManager.php +++ b/lib/Activity/ActivityManager.php @@ -404,13 +404,12 @@ private function createEvent($objectType, $entity, $subject, $additionalParams = $subjectParams['stack'] = $this->stackMapper->find($additionalParams['after']); } - $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());