Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity\AppInfo;

use OC\DB\ConnectionAdapter;
Expand Down Expand Up @@ -83,12 +84,12 @@ public function register(IRegistrationContext $context): void {
$systemConfig = $c->get(SystemConfig::class);
$configPrefix = 'activity_';

if ($systemConfig->getValue($configPrefix . 'dbuser', null) === null &&
$systemConfig->getValue($configPrefix . 'dbpassword', null) === null &&
$systemConfig->getValue($configPrefix . 'dbname', null) === null &&
$systemConfig->getValue($configPrefix . 'dbhost', null) === null &&
$systemConfig->getValue($configPrefix . 'dbport', null) === null &&
$systemConfig->getValue($configPrefix . 'dbdriveroptions', null) === null) {
if ($systemConfig->getValue($configPrefix . 'dbuser', null) === null
&& $systemConfig->getValue($configPrefix . 'dbpassword', null) === null
&& $systemConfig->getValue($configPrefix . 'dbname', null) === null
&& $systemConfig->getValue($configPrefix . 'dbhost', null) === null
&& $systemConfig->getValue($configPrefix . 'dbport', null) === null
&& $systemConfig->getValue($configPrefix . 'dbdriveroptions', null) === null) {
return $c->get(IDBConnection::class);
}

Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJob/EmailNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity\BackgroundJob;

use OCA\Activity\MailQueueHandler;
Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJob/ExpireActivities.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity\BackgroundJob;

use OCA\Activity\Data;
Expand Down
1 change: 1 addition & 0 deletions lib/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity;

use OCP\Activity\ActivitySettings;
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/APIv2Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity\Controller;

use OCA\Activity\Data;
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/ActivitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity\Controller;

use OCA\Activity\Data;
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity\Controller;

use OCA\Activity\Data;
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity\Controller;

use OCA\Activity\CurrentUser;
Expand Down
5 changes: 3 additions & 2 deletions lib/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity;

use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand Down Expand Up @@ -272,8 +273,8 @@ public function get(GroupHelper $groupHelper, UserSettings $userSettings, $user,
}

if (
$filter === 'files_favorites' ||
(in_array($filter, ['all', 'by', 'self']) && $userSettings->getUserSetting($user, 'stream', 'files_favorites'))
$filter === 'files_favorites'
|| (in_array($filter, ['all', 'by', 'self']) && $userSettings->getUserSetting($user, 'stream', 'files_favorites'))
) {
try {
$favoriteFilter = $this->activityManager->getFilterById('files_favorites');
Expand Down
1 change: 1 addition & 0 deletions lib/Event/LoadAdditionalScriptsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Activity\Event;

use OCP\EventDispatcher\Event;
Expand Down
9 changes: 2 additions & 7 deletions lib/FilesHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ protected function addNotificationsForFileAction($filePath, $activityType, $subj
$affectedUsers = array_merge($affectedUsers, $this->getAffectedUsersFromCachedMounts($fileId));
}

[$filteredEmailUsers, $filteredNotificationUsers] =
$this->getFileChangeActivitySettings($fileId, array_keys($affectedUsers), $activityType);
[$filteredEmailUsers, $filteredNotificationUsers]
= $this->getFileChangeActivitySettings($fileId, array_keys($affectedUsers), $activityType);

foreach ($affectedUsers as $user => $path) {
$user = (string)$user;
Expand Down Expand Up @@ -301,7 +301,6 @@ public function fileMove($oldPath, $newPath) {
}
}


/**
* Store the move hook events
*
Expand All @@ -328,7 +327,6 @@ public function fileMovePost($oldPath, $newPath) {
$this->moveCase = false;
}


/**
* Renaming a file inside the same folder (a/b to a/c)
*
Expand Down Expand Up @@ -1235,7 +1233,6 @@ protected function commitActivityTransaction(bool $shouldFlush): void {
$this->connection->commit();
}


/**
* @param int $fileId
*
Expand Down Expand Up @@ -1264,7 +1261,6 @@ private function getAffectedUsersFromCachedMounts(int $fileId): array {
}, ARRAY_FILTER_USE_KEY);
}


/**
* returns an array of users that have confirmed no access to fileId
*
Expand Down Expand Up @@ -1389,7 +1385,6 @@ private function getUnrelatedUsers(int $fileId, array $cachedMounts): array {
}
}


// now that we have a list of eventuals filtered users, we confirm they have no access to the file
$filteredUsers = [];
foreach ($usersToCheck as $userId) {
Expand Down
1 change: 1 addition & 0 deletions lib/GroupHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/

namespace OCA\Activity;

use OCP\Activity\Exceptions\UnknownActivityException;
Expand Down
1 change: 0 additions & 1 deletion lib/Listener/AddMissingIndicesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
class AddMissingIndicesListener implements IEventListener {
#[\Override]

public function handle(Event $event): void {
if (!($event instanceof AddMissingIndicesEvent)) {
return;
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2010Date20190416112817.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Activity\Migration;

use Closure;
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2011Date20201006132544.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Activity\Migration;

use Closure;
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2011Date20201006132545.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Activity\Migration;

use Closure;
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2011Date20201006132546.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Activity\Migration;

use Closure;
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2011Date20201006132547.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Activity\Migration;

use Closure;
Expand Down
1 change: 0 additions & 1 deletion lib/Settings/Personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public function getForm(): TemplateResponse {
$this->initialState->provideInitialState('methods', $methods);
$this->initialState->provideInitialState('activity_digest_enabled', $this->userSettings->getUserSetting($this->userId, 'setting', 'activity_digest'));


return new TemplateResponse('activity', 'settings/personal', [
'setting' => 'personal',
'activityGroups' => $activityGroups,
Expand Down
1 change: 0 additions & 1 deletion lib/ViewInfoCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class ViewInfoCache {
/** @var array */
protected $cacheId;


public function __construct(
protected IRootFolder $rootFolder,
) {
Expand Down
1 change: 0 additions & 1 deletion tests/Controller/FeedControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ protected function setUp(): void {
);
}


public function showData(): array {
return [
['application/rss+xml', 'application/rss+xml'],
Expand Down
1 change: 0 additions & 1 deletion tests/GroupHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ public function testGetEventFromArray(array $activity): void {
$this->assertSame($event, $instance);
}


protected function createEvent(array $data): IEvent {
/** @var IEvent|MockObject $event */
$event = $this->createMock(IEvent::class);
Expand Down
1 change: 0 additions & 1 deletion tests/MailQueueHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class MailQueueHandlerTest extends TestCase {
/** @var MockObject|UserSettings */
protected UserSettings $userSettings;


protected function setUp(): void {
parent::setUp();

Expand Down
10 changes: 5 additions & 5 deletions tests/stubs/oca_theming_defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
namespace OCA\Theming {
interface ThemingDefaults {
public function getName(): string;

public function getHTMLName(): string;

public function getTitle(): string;

public function getProductName(): string;

public function getBaseUrl(): string;

public function getSlogan(?string $lang = null): string;

public function getImprintUrl(): string;

public function getPrivacyUrl(): string;
}
}
Loading