From 08383dd43dce4c998d2699b62e6ebb90b246ecdd Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 21 Apr 2020 19:45:42 -0600 Subject: [PATCH 1/2] Update PublicApiControllers, fix block/mutes filtering on public timeline --- app/Http/Controllers/PublicApiController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index adcb32de..51815c9c 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -239,6 +239,11 @@ class PublicApiController extends Controller $max = $request->input('max_id'); $limit = $request->input('limit') ?? 3; + $filtered = UserFilter::whereUserId(Auth::user()->profile_id) + ->whereFilterableType('App\Profile') + ->whereIn('filter_type', ['mute', 'block']) + ->pluck('filterable_id')->toArray(); + if($min || $max) { $dir = $min ? '>' : '<'; $id = $min ?? $max; @@ -263,6 +268,7 @@ class PublicApiController extends Controller 'updated_at' )->where('id', $dir, $id) ->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) + ->whereNotIn('profile_id', $filtered) ->whereLocal(true) ->whereVisibility('public') ->orderBy('created_at', 'desc') @@ -289,6 +295,7 @@ class PublicApiController extends Controller 'reblogs_count', 'updated_at' )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) + ->whereNotIn('profile_id', $filtered) ->with('profile', 'hashtags', 'mentions') ->whereLocal(true) ->whereVisibility('public') From 5a8d15d84f5d6defd0fdc9fc132d112f0a07abfc Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 21 Apr 2020 19:46:21 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d35654a..6f723176 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Updated 2FA Checkpoint, add username + logout button and numeric inputmode ([26affb11](https://github.com/pixelfed/pixelfed/commit/26affb11)) - Updated RemoteProfile, fix missing content warnings ([e487527a](https://github.com/pixelfed/pixelfed/commit/e487527a)) - Updated RemotePost component, fix missing like button on comments ([7ef90565](https://github.com/pixelfed/pixelfed/commit/7ef90565)) +- Updated PublicApiControllers, fix block/mutes filtering on public timeline ([08383dd4](https://github.com/pixelfed/pixelfed/commit/08383dd4)) ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)