From b3ef2b2902d98f8920c907778bfba0e2ba2985f9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 10 Mar 2022 23:38:10 -0700 Subject: [PATCH] Improve reblog api performance --- app/Http/Controllers/Api/ApiV1Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index d2abdbeff..da6418aa4 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -2238,7 +2238,7 @@ class ApiV1Controller extends Controller if($status->profile_id !== $user->profile_id) { if($status->scope == 'private') { - abort_if(!$status->profile->followedBy($user->profile), 403); + abort_if(!FollowerService::follows($user->profile_id, $status->profile_id), 403); } else { abort_if(!in_array($status->scope, ['public','unlisted']), 403); } @@ -2281,7 +2281,7 @@ class ApiV1Controller extends Controller if($status->profile_id !== $user->profile_id) { if($status->scope == 'private') { - abort_if(!$status->profile->followedBy($user->profile), 403); + abort_if(!FollowerService::follows($user->profile_id, $status->profile_id), 403); } else { abort_if(!in_array($status->scope, ['public','unlisted']), 403); }