mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Hydrate favourited
and reblogged
state on v1 context endpoint
This commit is contained in:
parent
6d52550ee1
commit
abb4f7e1ec
1 changed files with 6 additions and 0 deletions
|
@ -2208,6 +2208,7 @@ class ApiV1Controller extends Controller
|
|||
abort_if(!$request->user(), 403);
|
||||
|
||||
$user = $request->user();
|
||||
$pid = $user->profile_id;
|
||||
$status = StatusService::getMastodon($id, false);
|
||||
|
||||
if(!$status || !isset($status['account'])) {
|
||||
|
@ -2244,6 +2245,11 @@ class ApiV1Controller extends Controller
|
|||
->filter(function($post) {
|
||||
return $post && isset($post['account']);
|
||||
})
|
||||
->map(function($status) use($pid) {
|
||||
$status['favourited'] = LikeService::liked($pid, $status['id']);
|
||||
$status['reblogged'] = ReblogService::get($pid, $status['id']);
|
||||
return $status;
|
||||
})
|
||||
->values();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue