diff options
author | Joas Schilling <coding@schilljs.com> | 2022-04-20 16:20:46 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-04-20 16:20:46 +0300 |
commit | daa294a5d15ba4998bd91e909b5facb76f52b933 (patch) | |
tree | 4479382f06853802f820d2f7cdffe4d7bf0a1fc5 /lib | |
parent | cddb08e4f246d66e6b3f1e7129e9dd2ec3516bad (diff) |
Use actor and time information from the reaction not the message author
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Chat/Notifier.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Chat/Notifier.php b/lib/Chat/Notifier.php index b90931902..7891db273 100644 --- a/lib/Chat/Notifier.php +++ b/lib/Chat/Notifier.php @@ -282,7 +282,7 @@ class Notifier { if ($notificationLevel === Participant::NOTIFY_ALWAYS) { $notification = $this->createNotification($chat, $comment, 'reaction', [ 'reaction' => $reaction->getMessage(), - ]); + ], $reaction); $notification->setUser($comment->getActorId()); $this->notificationManager->notify($notification); } @@ -388,9 +388,9 @@ class Notifier { * @param array $subjectData * @return INotification */ - private function createNotification(Room $chat, IComment $comment, string $subject, array $subjectData = []): INotification { - $subjectData['userType'] = $comment->getActorType(); - $subjectData['userId'] = $comment->getActorId(); + private function createNotification(Room $chat, IComment $comment, string $subject, array $subjectData = [], ?IComment $reaction = null): INotification { + $subjectData['userType'] = $reaction ? $reaction->getActorType() : $comment->getActorType(); + $subjectData['userId'] = $reaction ? $reaction->getActorId() : $comment->getActorId(); $notification = $this->notificationManager->createNotification(); $notification @@ -400,7 +400,7 @@ class Notifier { ->setMessage($comment->getVerb(), [ 'commentId' => $comment->getId(), ]) - ->setDateTime($comment->getCreationDateTime()); + ->setDateTime($reaction ? $reaction->getCreationDateTime() : $comment->getCreationDateTime()); return $notification; } |