From 71f6cbb5a6c8b64f11c44a8986dd600c02df1ffd Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 10 Jan 2020 21:53:24 -0700 Subject: [PATCH] Update StoryController --- app/Http/Controllers/StoryController.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/StoryController.php b/app/Http/Controllers/StoryController.php index 8cb867471..f5d8d54b3 100644 --- a/app/Http/Controllers/StoryController.php +++ b/app/Http/Controllers/StoryController.php @@ -103,7 +103,7 @@ class StoryController extends Controller abort_if(!config('instance.stories.enabled') || !$request->user(), 404); $profile = $request->user()->profile; - $following = FollowerService::build()->profile($profile)->following(); + $following = $profile->following->pluck('id')->toArray(); $stories = Story::with('profile') ->whereIn('profile_id', $following) @@ -136,8 +136,7 @@ class StoryController extends Controller if($id == $profile->id) { $publicOnly = true; } else { - $following = FollowerService::build()->profile($profile)->following(); - $publicOnly = in_array($id, $following); + $publicOnly = (bool) !$profile->followedBy($authed); } $stories = Story::whereProfileId($id) @@ -173,8 +172,7 @@ class StoryController extends Controller if($id == $authed->id) { $publicOnly = true; } else { - $following = FollowerService::build()->profile($authed)->following(); - $publicOnly = in_array($id, $following); + $publicOnly = (bool) !$profile->followedBy($authed); } $stories = Story::whereProfileId($profile->id)