diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index 54d50a47dcbc9..5c306fe639921 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -21,20 +21,10 @@ use OCP\IRequest; use OCP\IUser; use OCP\IUserSession; +use OCP\RichObjectStrings\IRichTextFormatter; use OCP\RichObjectStrings\IValidator; class Manager implements IManager { - /** @var IRequest */ - protected $request; - - /** @var IUserSession */ - protected $session; - - /** @var IConfig */ - protected $config; - - /** @var IValidator */ - protected $validator; /** @var string */ protected $formattingObjectType; @@ -48,20 +38,14 @@ class Manager implements IManager { /** @var string */ protected $currentUserId; - protected $l10n; - public function __construct( - IRequest $request, - IUserSession $session, - IConfig $config, - IValidator $validator, - IL10N $l10n + protected IRequest $request, + protected IUserSession $session, + protected IConfig $config, + protected IValidator $validator, + protected IRichTextFormatter $richTextFormatter, + protected IL10N $l10n, ) { - $this->request = $request; - $this->session = $session; - $this->config = $config; - $this->validator = $validator; - $this->l10n = $l10n; } /** @var \Closure[] */ @@ -104,7 +88,7 @@ protected function getConsumers(): array { * @return IEvent */ public function generateEvent(): IEvent { - return new Event($this->validator); + return new Event($this->validator, $this->richTextFormatter); } /** diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php index 8edbca0380d1c..ac287e970483c 100644 --- a/lib/private/Notification/Manager.php +++ b/lib/private/Notification/Manager.php @@ -22,6 +22,7 @@ use OCP\Notification\INotification; use OCP\Notification\INotifier; use OCP\Notification\UnknownNotificationException; +use OCP\RichObjectStrings\IRichTextFormatter; use OCP\RichObjectStrings\IValidator; use OCP\Support\Subscription\IRegistry; use Psr\Container\ContainerExceptionInterface; @@ -55,6 +56,7 @@ public function __construct( protected IRegistry $subscription, protected LoggerInterface $logger, private Coordinator $coordinator, + private IRichTextFormatter $richTextFormatter, ) { $this->cache = $cacheFactory->createDistributed('notifications'); @@ -199,7 +201,7 @@ public function getNotifiers(): array { * @since 8.2.0 */ public function createNotification(): INotification { - return new Notification($this->validator); + return new Notification($this->validator, $this->richTextFormatter); } /** diff --git a/lib/private/Server.php b/lib/private/Server.php index fb751104fd92a..f48cc0d0a48db 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -204,6 +204,7 @@ use OCP\Profiler\IProfiler; use OCP\Remote\Api\IApiFactory; use OCP\Remote\IInstanceFactory; +use OCP\RichObjectStrings\IRichTextFormatter; use OCP\RichObjectStrings\IValidator; use OCP\Route\IRouter; use OCP\Security\Bruteforce\IThrottler; @@ -648,6 +649,7 @@ public function __construct($webRoot, \OC\Config $config) { $c->get(IUserSession::class), $c->get(\OCP\IConfig::class), $c->get(IValidator::class), + $c->get(IRichTextFormatter::class), $l10n ); }); @@ -1285,7 +1287,7 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerAlias(\OCP\Security\Ip\IFactory::class, \OC\Security\Ip\Factory::class); - $this->registerAlias(\OCP\RichObjectStrings\IRichTextFormatter::class, \OC\RichObjectStrings\RichTextFormatter::class); + $this->registerAlias(IRichTextFormatter::class, \OC\RichObjectStrings\RichTextFormatter::class); $this->connectDispatcher(); }