mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-25 22:10:47 +00:00
Update LikePipeline, prevent duplicate like notifications
This commit is contained in:
parent
1d5226c3c6
commit
86efcceb4c
1 changed files with 8 additions and 1 deletions
|
@ -37,7 +37,14 @@ class LikePipeline implements ShouldQueue
|
||||||
$status = $this->like->status;
|
$status = $this->like->status;
|
||||||
$actor = $this->like->actor;
|
$actor = $this->like->actor;
|
||||||
|
|
||||||
if($actor->id === $status->profile_id) {
|
$exists = Notification::whereProfileId($status->profile_id)
|
||||||
|
->whereActorId($actor->id)
|
||||||
|
->whereAction('like')
|
||||||
|
->whereItemId($status->id)
|
||||||
|
->whereItemType('App\Status')
|
||||||
|
->count();
|
||||||
|
|
||||||
|
if($actor->id === $status->profile_id || $exists !== 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue