mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Update FederationController, add proper statuses counts
This commit is contained in:
parent
3204fb9669
commit
dec061f5ae
1 changed files with 5 additions and 2 deletions
|
@ -124,12 +124,15 @@ class FederationController extends Controller
|
||||||
return redirect('/' . $username);
|
return redirect('/' . $username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$id = AccountService::usernameToId($username);
|
||||||
|
abort_if(!$id, 404);
|
||||||
|
$account = AccountService::get($id);
|
||||||
|
abort_if(!$account || !isset($account['statuses_count']), 404);
|
||||||
$res = [
|
$res = [
|
||||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||||
'id' => 'https://' . config('pixelfed.domain.app') . '/users/' . $username . '/outbox',
|
'id' => 'https://' . config('pixelfed.domain.app') . '/users/' . $username . '/outbox',
|
||||||
'type' => 'OrderedCollection',
|
'type' => 'OrderedCollection',
|
||||||
'totalItems' => 0,
|
'totalItems' => $account['statuses_count'] ?? 0,
|
||||||
'orderedItems' => []
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return response(json_encode($res, JSON_UNESCAPED_SLASHES))->header('Content-Type', 'application/activity+json');
|
return response(json_encode($res, JSON_UNESCAPED_SLASHES))->header('Content-Type', 'application/activity+json');
|
||||||
|
|
Loading…
Reference in a new issue