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
1 changed files with 8 additions and 0 deletions

View File

@ -2298,6 +2298,14 @@ class ApiV1Controller extends Controller
$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) {
$link = '<'.$baseUrl.'max_id='.$minId.'>; rel="next"';
}