mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update LikeController
This commit is contained in:
parent
5ec4b8f8d2
commit
e334eaa809
2 changed files with 7 additions and 2 deletions
|
@ -27,7 +27,7 @@ class LikeController extends Controller
|
|||
|
||||
if($status->likes()->whereProfileId($profile->id)->count() !== 0) {
|
||||
$like = Like::whereProfileId($profile->id)->whereStatusId($status->id)->firstOrFail();
|
||||
$like->delete();
|
||||
$like->forceDelete();
|
||||
$count--;
|
||||
} else {
|
||||
$like = new Like;
|
||||
|
@ -35,9 +35,9 @@ class LikeController extends Controller
|
|||
$like->status_id = $status->id;
|
||||
$like->save();
|
||||
$count++;
|
||||
LikePipeline::dispatch($like);
|
||||
}
|
||||
|
||||
LikePipeline::dispatch($like);
|
||||
|
||||
if($request->ajax()) {
|
||||
$response = ['code' => 200, 'msg' => 'Like saved', 'count' => $count];
|
||||
|
|
|
@ -37,6 +37,11 @@ class LikePipeline implements ShouldQueue
|
|||
$status = $this->like->status;
|
||||
$actor = $this->like->actor;
|
||||
|
||||
if($status->url !== null) {
|
||||
// Ignore notifications to remote statuses
|
||||
return;
|
||||
}
|
||||
|
||||
$exists = Notification::whereProfileId($status->profile_id)
|
||||
->whereActorId($actor->id)
|
||||
->whereAction('like')
|
||||
|
|
Loading…
Reference in a new issue