Update ApiV1Controller, fix notifications favourited/reblogged/bookmarked state. Fixes #5901

pull/5925/head
Daniel Supernault 7 months ago
parent cc6f0debc2
commit 8a86808a06
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -2441,6 +2441,14 @@ class ApiV1Controller extends Controller
return true;
})
->map(function($n) use($pid) {
if(isset($n['status'])) {
$n['status']['favourited'] = (bool) LikeService::liked($pid, $n['status']['id']);
$n['status']['reblogged'] = (bool) ReblogService::get($pid, $n['status']['id']);
$n['status']['bookmarked'] = (bool) BookmarkService::get($pid, $n['status']['id']);
}
return $n;
})
->filter(function ($n) use ($types) {
if (! $types) {
return true;

Loading…
Cancel
Save