mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update ApiV1Controller, fix private status replies returning 404
This commit is contained in:
parent
a11772bcfe
commit
73226360fc
1 changed files with 8 additions and 2 deletions
|
@ -2514,9 +2514,15 @@ class ApiV1Controller extends Controller
|
||||||
|
|
||||||
$limit = $request->input('limit', 3);
|
$limit = $request->input('limit', 3);
|
||||||
$pid = $request->user()->profile_id;
|
$pid = $request->user()->profile_id;
|
||||||
$status = StatusService::getMastodon($id);
|
$status = StatusService::getMastodon($id, false);
|
||||||
|
|
||||||
abort_if(!$status || !in_array($status['visibility'], ['public', 'unlisted']), 404);
|
abort_if(!$status, 404);
|
||||||
|
|
||||||
|
if($status['visibility'] == 'private') {
|
||||||
|
if($pid != $status['account']['id']) {
|
||||||
|
abort_unless(FollowerService::follows($pid, $status['account']['id']), 404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sortBy = $request->input('sort', 'all');
|
$sortBy = $request->input('sort', 'all');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue