diff --git a/lib/Consumer.php b/lib/Consumer.php index a60528540..9a8b8a21f 100644 --- a/lib/Consumer.php +++ b/lib/Consumer.php @@ -67,10 +67,7 @@ public function receive(IEvent $event) { $emailSetting = $this->userSettings->getUserSetting($event->getAffectedUser(), 'email', $event->getType()); $emailSetting = ($emailSetting) ? $this->userSettings->getUserSetting($event->getAffectedUser(), 'setting', 'batchtime') : false; - // Add activity to stream - if (!$selfAction) { - $activityId = $this->data->send($event); - } + $activityId = $this->data->send($event); if (!$selfAction && $notificationSetting && $activityId) { $this->notificationGenerator->sendNotificationForEvent($event, $activityId); diff --git a/tests/ConsumerTest.php b/tests/ConsumerTest.php index ffde9d6fb..15a982bd8 100644 --- a/tests/ConsumerTest.php +++ b/tests/ConsumerTest.php @@ -144,7 +144,7 @@ public function receiveData(): array { * @param string $subject * @param array|false $expected */ - public function testReceiveStream(string $type, string $author, string $affectedUser, string $subject, $expected): void { + public function testReceiveStream(string $type, string $author, string $affectedUser, string $subject): void { $consumer = new Consumer($this->data, $this->activityManager, $this->userSettings, $this->notificationGenerator); $event = \OC::$server->getActivityManager()->generateEvent(); $event->setApp('test') @@ -158,13 +158,8 @@ public function testReceiveStream(string $type, string $author, string $affected ->setLink('link'); $this->deleteTestActivities(); - if ($author === $affectedUser) { - $this->data->expects($this->never()) - ->method('send'); - } else { - $this->data->expects($this->once()) - ->method('send'); - } + $this->data->expects($this->once()) + ->method('send'); $consumer->receive($event); }