diff --git a/lib/Data.php b/lib/Data.php index 65f8752ae..d0eee041b 100755 --- a/lib/Data.php +++ b/lib/Data.php @@ -188,17 +188,6 @@ public function get(GroupHelper $groupHelper, UserSettings $userSettings, $user, } else if ($filter === 'by') { $query->andWhere($query->expr()->neq('user', $query->createNamedParameter($user))); - } else if ($filter === 'all' && !$userSettings->getUserSetting($user, 'setting', 'self')) { - $query->andWhere($query->expr()->orX( - $query->expr()->neq('user', $query->createNamedParameter($user)), - $query->expr()->notIn('type', $query->createNamedParameter([ - 'file_created', - 'file_changed', - 'file_deleted', - 'file_restored', - ], IQueryBuilder::PARAM_STR_ARRAY)) - )); - } else if ($filter === 'filter') { if (!$userSettings->getUserSetting($user, 'setting', 'self')) { $query->andWhere($query->expr()->orX( diff --git a/lib/FilesHooks.php b/lib/FilesHooks.php index ab4c8a86e..956ffc0ef 100755 --- a/lib/FilesHooks.php +++ b/lib/FilesHooks.php @@ -1174,12 +1174,10 @@ protected function addNotificationsForUser($user, $subject, $subjectParams, $fil } // Add activity to stream - if (!$selfAction || $this->userSettings->getUserSetting($this->currentUser->getUID(), 'setting', 'self')) { - $activityId = $this->activityData->send($event); + $activityId = $this->activityData->send($event); - if ($activityId && !$selfAction && $notificationSetting) { - $this->notificationGenerator->sendNotificationForEvent($event, $activityId); - } + if ($activityId && !$selfAction && $notificationSetting) { + $this->notificationGenerator->sendNotificationForEvent($event, $activityId); } // Add activity to mail queue diff --git a/tests/FilesHooksTest.php b/tests/FilesHooksTest.php index 73ac77322..e8d0ad62f 100755 --- a/tests/FilesHooksTest.php +++ b/tests/FilesHooksTest.php @@ -1057,7 +1057,7 @@ public function testAddNotificationsForUser(string $user, string $subject, array ->method('generateEvent') ->willReturn($event); - $this->data->expects(($user !== 'user' || $selfSetting) ? $this->once() : $this->never()) + $this->data->expects($this->once()) ->method('send') ->with($event); $this->data->expects($sentEmail ? $this->once() : $this->never())