diff options
author | Joas Schilling <coding@schilljs.com> | 2022-03-10 18:48:32 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-03-10 19:03:53 +0300 |
commit | 9687533ec56d4d40ec6ca114592b125df77ab354 (patch) | |
tree | 8c0866a16c6a6177cf1fed971ba0db10eeca5d2e /lib | |
parent | 03c4cd69114255b0e40402501952613015e75b50 (diff) |
Add a system message
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Chat/ReactionManager.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Chat/ReactionManager.php b/lib/Chat/ReactionManager.php index 47d13e46c..af0133268 100644 --- a/lib/Chat/ReactionManager.php +++ b/lib/Chat/ReactionManager.php @@ -37,6 +37,8 @@ use OCP\Comments\NotFoundException; use OCP\IL10N; class ReactionManager { + /** @var ChatManager */ + private $chatManager; /** @var ICommentsManager|CommentsManager */ private $commentsManager; /** @var IL10N */ @@ -48,11 +50,13 @@ class ReactionManager { /** @var ITimeFactory */ protected $timeFactory; - public function __construct(CommentsManager $commentsManager, + public function __construct(ChatManager $chatManager, + CommentsManager $commentsManager, IL10N $l, MessageParser $messageParser, Notifier $notifier, ITimeFactory $timeFactory) { + $this->chatManager = $chatManager; $this->commentsManager = $commentsManager; $this->l = $l; $this->messageParser = $messageParser; @@ -133,6 +137,18 @@ class ReactionManager { ); $comment->setVerb('reaction_deleted'); $this->commentsManager->save($comment); + + $this->chatManager->addSystemMessage( + $chat, + $participant->getAttendee()->getActorType(), + $participant->getAttendee()->getActorId(), + json_encode(['message' => 'reaction_deleted', 'parameters' => ['message' => (int) $comment->getId()]]), + $this->timeFactory->getDateTime(), + false, + null, + $messageId + ); + return $comment; } |