mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update LikeService, skip self likes
This commit is contained in:
parent
cc47243733
commit
3741c76da3
1 changed files with 9 additions and 1 deletions
|
@ -62,8 +62,16 @@ class LikeService {
|
|||
if(!$status->likes_count) {
|
||||
return $empty;
|
||||
}
|
||||
$user = request()->user();
|
||||
|
||||
$like = Like::whereStatusId($status->id)->first();
|
||||
if($user) {
|
||||
$like = Like::whereStatusId($status->id)
|
||||
->where('profile_id', '!=', $user->profile_id)
|
||||
->first();
|
||||
} else {
|
||||
$like = Like::whereStatusId($status->id)
|
||||
->first();
|
||||
}
|
||||
|
||||
if(!$like) {
|
||||
return $empty;
|
||||
|
|
Loading…
Reference in a new issue