update: always notify uploader/requester on replies

But don't send two notifications, one to the top level commenter, and one to the uploader, if they happen to be the same user. Keep the logic that notifies the top level commenter of any replies within.
This commit is contained in:
Roardom
2025-04-14 09:49:13 +00:00
parent ad1b66edcc
commit 39f4a15a7d
2 changed files with 10 additions and 6 deletions
+5 -1
View File
@@ -175,7 +175,11 @@ class Comment extends Component
case $this->model instanceof Playlist:
case $this->model instanceof TorrentRequest:
case $this->model instanceof Torrent:
if ($this->user->id !== $this->comment->user_id) {
if ($this->user->id !== $this->model->user_id) {
User::find($this->model->user_id)?->notify(new NewComment($this->model, $reply));
}
if ($this->user->id !== $this->comment->user_id && $this->comment->user_id !== $this->model->user_id) {
User::find($this->comment->user_id)?->notify(new NewComment($this->model, $reply));
}