diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-04-20 17:58:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 17:58:49 +0300 |
commit | 1fde38c8b1b2454757c5a4ac5d2ccb4df5360cef (patch) | |
tree | bdfa09b26e92b0a1028f7e16fe44db7336f16c84 /lib | |
parent | db385cce6805ee1dfafd89804383233ae3868e3b (diff) | |
parent | daa294a5d15ba4998bd91e909b5facb76f52b933 (diff) |
Merge pull request #7184 from nextcloud/bugfix/7153/fix-reaction-notification
Use actor and time information from the reaction not the message author
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; } |