Update PublicApiController, fix bug that does not show private posts in home timeline

This commit is contained in:
Daniel Supernault 2019-07-07 20:24:10 -06:00
parent c480a5a023
commit f86fc83cbd
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 12 additions and 0 deletions

View file

@ -211,6 +211,10 @@ class PublicApiController extends Controller
'limit' => 'nullable|integer|max:20'
]);
if(config('instance.timeline.local.is_public') == false && !Auth::check()) {
abort(403, 'Authentication required.');
}
$page = $request->input('page');
$min = $request->input('min_id');
$max = $request->input('max_id');
@ -331,6 +335,8 @@ class PublicApiController extends Controller
->orWhere('status', '!=', null)
->pluck('id');
});
$private = $private->diff($following)->flatten();
$filters = UserFilter::whereUserId($pid)
->whereFilterableType('App\Profile')