Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor OC\Server::getNotificationManager #40147

Merged
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
3 changes: 2 additions & 1 deletion core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use OCP\DB\Events\AddMissingIndicesEvent;
use OCP\DB\Events\AddMissingPrimaryKeyEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Notification\IManager as INotificationManager;
use OCP\User\Events\BeforeUserDeletedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\Util;
Expand All @@ -48,7 +49,7 @@ public function __construct() {
/** @var IEventDispatcher $eventDispatcher */
$eventDispatcher = $server->get(IEventDispatcher::class);

$notificationManager = $server->getNotificationManager();
$notificationManager = $server->get(INotificationManager::class);
$notificationManager->registerNotifierService(CoreNotifier::class);
$notificationManager->registerNotifierService(AuthenticationNotifier::class);

Expand Down
3 changes: 2 additions & 1 deletion lib/private/Repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
use OCP\Notification\IManager as INotificationManager;
use Psr\Log\LoggerInterface;
use Throwable;

Expand Down Expand Up @@ -168,7 +169,7 @@ public static function getRepairSteps(): array {
new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()),
new CleanupCardDAVPhotoCache(\OC::$server->getConfig(), \OC::$server->getAppDataDir('dav-photocache'), \OC::$server->get(LoggerInterface::class)),
new AddClenupLoginFlowV2BackgroundJob(\OC::$server->getJobList()),
new RemoveLinkShares(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig(), \OC::$server->getGroupManager(), \OC::$server->getNotificationManager(), \OCP\Server::get(ITimeFactory::class)),
new RemoveLinkShares(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig(), \OC::$server->getGroupManager(), \OC::$server->get(INotificationManager::class), \OCP\Server::get(ITimeFactory::class)),
new ClearCollectionsAccessCache(\OC::$server->getConfig(), \OCP\Server::get(IManager::class)),
\OCP\Server::get(ResetGeneratedAvatarFlag::class),
\OCP\Server::get(EncryptionLegacyCipher::class),
Expand Down
5 changes: 3 additions & 2 deletions lib/private/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserBackend;
use OCP\Notification\IManager as INotificationManager;
use OCP\User\Backend\IGetHomeBackend;
use OCP\User\Backend\IProvideAvatarBackend;
use OCP\User\Backend\IProvideEnabledStateBackend;
Expand Down Expand Up @@ -271,9 +272,9 @@ public function delete() {
$avatarManager = \OCP\Server::get(AvatarManager::class);
$avatarManager->deleteUserAvatar($this->uid);

$notification = \OC::$server->getNotificationManager()->createNotification();
$notification = \OC::$server->get(INotificationManager::class)->createNotification();
$notification->setUser($this->uid);
\OC::$server->getNotificationManager()->markProcessed($notification);
\OC::$server->get(INotificationManager::class)->markProcessed($notification);

/** @var AccountManager $accountManager */
$accountManager = \OCP\Server::get(AccountManager::class);
Expand Down
Loading