fix: Fix Event and Notification creation with the new required parameter

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/48137/head
Côme Chilliet 1 year ago
parent 295eee6712
commit 117c7ee654
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 32
      lib/private/Activity/Manager.php
  2. 4
      lib/private/Notification/Manager.php
  3. 4
      lib/private/Server.php

@ -21,20 +21,10 @@ use OCP\IL10N;
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 @@ class Manager implements IManager {
* @return IEvent
*/
public function generateEvent(): IEvent {
return new Event($this->validator);
return new Event($this->validator, $this->richTextFormatter);
}
/**

@ -22,6 +22,7 @@ use OCP\Notification\IncompleteParsedNotificationException;
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 @@ class Manager implements IManager {
protected IRegistry $subscription,
protected LoggerInterface $logger,
private Coordinator $coordinator,
private IRichTextFormatter $richTextFormatter,
) {
$this->cache = $cacheFactory->createDistributed('notifications');
@ -199,7 +201,7 @@ class Manager implements IManager {
* @since 8.2.0
*/
public function createNotification(): INotification {
return new Notification($this->validator);
return new Notification($this->validator, $this->richTextFormatter);
}
/**

@ -204,6 +204,7 @@ use OCP\Profile\IProfileManager;
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 @@ class Server extends ServerContainer implements IServerContainer {
$c->get(IUserSession::class),
$c->get(\OCP\IConfig::class),
$c->get(IValidator::class),
$c->get(IRichTextFormatter::class),
$l10n
);
});
@ -1285,7 +1287,7 @@ class Server extends ServerContainer implements IServerContainer {
$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();
}

Loading…
Cancel
Save