From e1c6297ee7ff38241a3c75a03c2f99c394cc9230 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 3 Mar 2021 20:18:32 -0700 Subject: [PATCH] Update PublicApiController, show unlisted comments --- app/Http/Controllers/PublicApiController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index c1e8ef9f0..7e1d6623e 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -154,10 +154,10 @@ class PublicApiController extends Controller ->whereFilterableType('App\Profile') ->whereIn('filter_type', ['mute', 'block']) ->pluck('filterable_id')->toArray(); - $scope = $p->id == $status->profile_id ? ['public', 'private'] : ['public']; + $scope = $p->id == $status->profile_id ? ['public', 'private', 'unlisted'] : ['public','unlisted']; } else { $filtered = []; - $scope = ['public']; + $scope = ['public', 'unlisted']; } if($request->filled('min_id') || $request->filled('max_id')) { @@ -166,7 +166,7 @@ class PublicApiController extends Controller ->whereNull('reblog_of_id') ->whereIn('scope', $scope) ->whereNotIn('profile_id', $filtered) - ->select('id', 'caption', 'local', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at') + ->select('id', 'caption', 'local', 'visibility', 'scope', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at') ->where('id', '>=', $request->min_id) ->orderBy('id', 'desc') ->paginate($limit); @@ -176,7 +176,7 @@ class PublicApiController extends Controller ->whereNull('reblog_of_id') ->whereIn('scope', $scope) ->whereNotIn('profile_id', $filtered) - ->select('id', 'caption', 'local', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at') + ->select('id', 'caption', 'local', 'visibility', 'scope', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at') ->where('id', '<=', $request->max_id) ->orderBy('id', 'desc') ->paginate($limit); @@ -186,7 +186,7 @@ class PublicApiController extends Controller ->whereNull('reblog_of_id') ->whereIn('scope', $scope) ->whereNotIn('profile_id', $filtered) - ->select('id', 'caption', 'local', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at') + ->select('id', 'caption', 'local', 'visibility', 'scope', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at') ->orderBy('id', 'desc') ->paginate($limit); }