mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 13:33:18 +00:00
commit
3ce9af33ee
1 changed files with 3 additions and 5 deletions
|
@ -103,7 +103,7 @@ class StoryController extends Controller
|
||||||
abort_if(!config('instance.stories.enabled') || !$request->user(), 404);
|
abort_if(!config('instance.stories.enabled') || !$request->user(), 404);
|
||||||
|
|
||||||
$profile = $request->user()->profile;
|
$profile = $request->user()->profile;
|
||||||
$following = FollowerService::build()->profile($profile)->following();
|
$following = $profile->following->pluck('id')->toArray();
|
||||||
|
|
||||||
$stories = Story::with('profile')
|
$stories = Story::with('profile')
|
||||||
->whereIn('profile_id', $following)
|
->whereIn('profile_id', $following)
|
||||||
|
@ -136,8 +136,7 @@ class StoryController extends Controller
|
||||||
if($id == $profile->id) {
|
if($id == $profile->id) {
|
||||||
$publicOnly = true;
|
$publicOnly = true;
|
||||||
} else {
|
} else {
|
||||||
$following = FollowerService::build()->profile($profile)->following();
|
$publicOnly = (bool) !$profile->followedBy($authed);
|
||||||
$publicOnly = in_array($id, $following);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$stories = Story::whereProfileId($id)
|
$stories = Story::whereProfileId($id)
|
||||||
|
@ -173,8 +172,7 @@ class StoryController extends Controller
|
||||||
if($id == $authed->id) {
|
if($id == $authed->id) {
|
||||||
$publicOnly = true;
|
$publicOnly = true;
|
||||||
} else {
|
} else {
|
||||||
$following = FollowerService::build()->profile($authed)->following();
|
$publicOnly = (bool) !$profile->followedBy($authed);
|
||||||
$publicOnly = in_array($id, $following);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$stories = Story::whereProfileId($profile->id)
|
$stories = Story::whereProfileId($profile->id)
|
||||||
|
|
Loading…
Reference in a new issue