Merge pull request #56220 from nextcloud/backport/56190/stable32

[stable32] fix(activity): do not loop affected userIDs twice
This commit is contained in:
Joas Schilling 2025-11-06 08:52:54 +01:00 committed by GitHub
commit cb383571a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,10 +124,8 @@ class Manager implements IManager {
throw new IncompleteActivityException('The given event is invalid');
}
if ($event->getAuthor() === '') {
if ($this->session->getUser() instanceof IUser) {
$event->setAuthor($this->session->getUser()->getUID());
}
if (($event->getAuthor() === '') && $this->session->getUser() instanceof IUser) {
$event->setAuthor($this->session->getUser()->getUID());
}
if (!$event->getTimestamp()) {
@ -141,6 +139,7 @@ class Manager implements IManager {
foreach ($this->getConsumers() as $c) {
if ($c instanceof IBulkConsumer) {
$c->bulkReceive($event, $affectedUserIds, $setting);
continue;
}
foreach ($affectedUserIds as $affectedUserId) {
$event->setAffectedUser($affectedUserId);