1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 08:14:10 +00:00

Update LikePipeline, prevent duplicate like notifications

This commit is contained in:
Daniel Supernault 2018-06-07 00:14:32 -06:00
parent 1d5226c3c6
commit 86efcceb4c

View file

@ -37,7 +37,14 @@ class LikePipeline implements ShouldQueue
$status = $this->like->status;
$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;
}