mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 17:53:16 +00:00
Update ApiV1Controller, hydrate reblog state in home timeline
This commit is contained in:
parent
685d45a8df
commit
13bdaa2ed4
1 changed files with 16 additions and 0 deletions
|
@ -2199,6 +2199,14 @@ class ApiV1Controller extends Controller
|
||||||
->filter(function($status) {
|
->filter(function($status) {
|
||||||
return $status && isset($status['account']);
|
return $status && isset($status['account']);
|
||||||
})
|
})
|
||||||
|
->map(function($status) use($pid) {
|
||||||
|
if(!empty($status['reblog'])) {
|
||||||
|
$status['reblog']['favourited'] = (bool) LikeService::liked($pid, $status['reblog']['id']);
|
||||||
|
$status['reblog']['reblogged'] = (bool) ReblogService::get($pid, $status['reblog']['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $status;
|
||||||
|
})
|
||||||
->take($limit)
|
->take($limit)
|
||||||
->values();
|
->values();
|
||||||
} else {
|
} else {
|
||||||
|
@ -2242,6 +2250,14 @@ class ApiV1Controller extends Controller
|
||||||
->filter(function($status) {
|
->filter(function($status) {
|
||||||
return $status && isset($status['account']);
|
return $status && isset($status['account']);
|
||||||
})
|
})
|
||||||
|
->map(function($status) use($pid) {
|
||||||
|
if(!empty($status['reblog'])) {
|
||||||
|
$status['reblog']['favourited'] = (bool) LikeService::liked($pid, $status['reblog']['id']);
|
||||||
|
$status['reblog']['reblogged'] = (bool) ReblogService::get($pid, $status['reblog']['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $status;
|
||||||
|
})
|
||||||
->take($limit)
|
->take($limit)
|
||||||
->values();
|
->values();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue