Update ApiV1Controller, update Notifications endpoint to filter notifications with missing activities

This commit is contained in:
Daniel Supernault 2024-03-05 00:39:50 -07:00
parent 3f0539978e
commit a933615b8d
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -2298,6 +2298,14 @@ class ApiV1Controller extends Controller
$minId = null; $minId = null;
} }
$res = collect($res)->filter(function($n) {
if(in_array($n['type'], ['mention', 'reblog', 'favourite'])) {
return isset($n['status'], $n['status']['id']);
}
return isset($n['account'], $n['account']['id']);
})->values();
if($maxId) { if($maxId) {
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next"'; $link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next"';
} }