mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 17:26:43 +00:00
Update ApiV1Controller, filter mute/blocks on statuses/context and statuses/replies endpoints
This commit is contained in:
parent
988818be69
commit
73aa01e8e0
1 changed files with 9 additions and 3 deletions
|
@ -2501,6 +2501,8 @@ class ApiV1Controller extends Controller
|
|||
}
|
||||
|
||||
if($status['replies_count']) {
|
||||
$filters = UserFilterService::filters($pid);
|
||||
|
||||
$descendants = DB::table('statuses')
|
||||
->where('in_reply_to_id', $id)
|
||||
->limit(20)
|
||||
|
@ -2508,8 +2510,8 @@ class ApiV1Controller extends Controller
|
|||
->map(function($sid) {
|
||||
return StatusService::getMastodon($sid, false);
|
||||
})
|
||||
->filter(function($post) {
|
||||
return $post && isset($post['account']);
|
||||
->filter(function($post) use($filters) {
|
||||
return $post && isset($post['account'], $post['account']['id']) && !in_array($post['account']['id'], $filters);
|
||||
})
|
||||
->map(function($status) use($pid) {
|
||||
$status['favourited'] = LikeService::liked($pid, $status['id']);
|
||||
|
@ -3358,7 +3360,11 @@ class ApiV1Controller extends Controller
|
|||
->cursorPaginate($limit);
|
||||
}
|
||||
|
||||
$data = $ids->map(function($post) use($pid) {
|
||||
$filters = UserFilterService::filters($pid);
|
||||
$data = $ids->filter(function($post) use($filters) {
|
||||
return !in_array($post->profile_id, $filters);
|
||||
})
|
||||
->map(function($post) use($pid) {
|
||||
$status = StatusService::get($post->id, false);
|
||||
|
||||
if(!$status || !isset($status['id'])) {
|
||||
|
|
Loading…
Reference in a new issue