mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: Fix Event and Notification creation with the new required parameter
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
295eee6712
commit
117c7ee654
3 changed files with 14 additions and 26 deletions
|
|
@ -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…
Reference in a new issue