From f42c114058732bae4f65a5bbef6c337f299f9164 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 20 May 2023 22:57:42 -0600 Subject: [PATCH 1/3] Update ApiV1Controller, filter muted/blocked accounts from tag timeline. --- app/Http/Controllers/Api/ApiV1Controller.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index d72878e7d..d4e058300 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -3129,6 +3129,8 @@ class ApiV1Controller extends Controller } } + $filters = UserFilterService::filters($request->user()->profile_id); + if(!$min && !$max) { $id = 1; $dir = '>'; @@ -3146,6 +3148,9 @@ class ApiV1Controller extends Controller ->map(function ($i) use($pe) { return $pe ? StatusService::get($i) : StatusService::getMastodon($i); }) + ->filter(function($i) use($filters) { + return !in_array($i['account']['id'], $filters); + }) ->filter(function($i) use($onlyMedia) { if(!$i) { return false; From 607c64ae722c1d84961e1486b71ce1d66d14c72a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 20 May 2023 22:58:03 -0600 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1328b78..e54a800aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ - Update StatusController, disable post embeds from spam accounts ([c167af43](https://github.com/pixelfed/pixelfed/commit/c167af43)) - Update ProfileController, require login to view spam accounts, and disable profile embeds and atom feeds for spam accounts ([dd2f5bb9](https://github.com/pixelfed/pixelfed/commit/dd2f5bb9)) - Update Settings, allow users to disable atom feeds ([3662d3de](https://github.com/pixelfed/pixelfed/commit/3662d3de)) +- Update ApiV1Controller, filter muted/blocked accounts from tag timeline ([f42c1140](https://github.com/pixelfed/pixelfed/commit/f42c1140)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.6 (2023-05-03)](https://github.com/pixelfed/pixelfed/compare/v0.11.5...v0.11.6) From 79bcaadd49301209f996fcabe39f3e8408b6fbcd Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 20 May 2023 22:59:11 -0600 Subject: [PATCH 3/3] Update ApiV1Controller, filter muted/blocked accounts from tag timeline. --- app/Http/Controllers/Api/ApiV1Controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index d4e058300..9ac03a675 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -3148,9 +3148,6 @@ class ApiV1Controller extends Controller ->map(function ($i) use($pe) { return $pe ? StatusService::get($i) : StatusService::getMastodon($i); }) - ->filter(function($i) use($filters) { - return !in_array($i['account']['id'], $filters); - }) ->filter(function($i) use($onlyMedia) { if(!$i) { return false; @@ -3160,6 +3157,9 @@ class ApiV1Controller extends Controller } return $i && isset($i['account']); }) + ->filter(function($i) use($filters) { + return !in_array($i['account']['id'], $filters); + }) ->values() ->toArray();