From e7c4f084bc50d41155a5eed0d6a7ea8303c34db9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 19 Nov 2018 19:00:21 -0700 Subject: [PATCH] Update TimelineController --- app/Http/Controllers/TimelineController.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/TimelineController.php b/app/Http/Controllers/TimelineController.php index 83ad70efb..5ce51eb89 100644 --- a/app/Http/Controllers/TimelineController.php +++ b/app/Http/Controllers/TimelineController.php @@ -27,14 +27,13 @@ class TimelineController extends Controller // $timeline = Timeline::build()->local(); $pid = Auth::user()->profile->id; - $filtered = Cache::rememberForever("user:filter:list:$pid", function() use($pid) { - return UserFilter::whereUserId($pid) - ->whereFilterableType('App\Profile') - ->whereIn('filter_type', ['mute', 'block']) - ->pluck('filterable_id')->toArray(); - }); - $private = Profile::whereIsPrivate(true)->pluck('id'); - $filtered = array_merge($private->toArray(), $filtered); + $private = Profile::whereIsPrivate(true)->where('id', '!=', $pid)->pluck('id'); + $filters = UserFilter::whereUserId($pid) + ->whereFilterableType('App\Profile') + ->whereIn('filter_type', ['mute', 'block']) + ->pluck('filterable_id')->toArray(); + $filtered = array_merge($private->toArray(), $filters); + $timeline = Status::whereHas('media') ->whereNotIn('profile_id', $filtered) ->whereNull('in_reply_to_id')