Update ApiV1Controller, improve local/remote logic in public timeline endpoint

This commit is contained in:
Daniel Supernault 2022-06-13 03:08:43 -06:00
parent 434a99aac0
commit 4ff179ad4d
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 3 additions and 2 deletions

View File

@ -1973,14 +1973,15 @@ class ApiV1Controller extends Controller
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
'max_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
'limit' => 'nullable|integer|max:100',
'remote' => 'sometimes'
'remote' => 'sometimes',
'local' => 'sometimes'
]);
$min = $request->input('min_id');
$max = $request->input('max_id');
$limit = $request->input('limit') ?? 20;
$user = $request->user();
$remote = $request->has('remote');
$remote = ($request->has('remote') && $request->input('remote') == true) || ($request->filled('local') && $request->input('local') != true);
$filtered = $user ? UserFilterService::filters($user->profile_id) : [];
if($remote && config('instance.timeline.network.cached')) {