mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-30 02:03:16 +00:00
Update TimelineController
This commit is contained in:
parent
c41e6a761d
commit
e7c4f084bc
1 changed files with 7 additions and 8 deletions
|
@ -27,14 +27,13 @@ class TimelineController extends Controller
|
||||||
// $timeline = Timeline::build()->local();
|
// $timeline = Timeline::build()->local();
|
||||||
$pid = Auth::user()->profile->id;
|
$pid = Auth::user()->profile->id;
|
||||||
|
|
||||||
$filtered = Cache::rememberForever("user:filter:list:$pid", function() use($pid) {
|
$private = Profile::whereIsPrivate(true)->where('id', '!=', $pid)->pluck('id');
|
||||||
return UserFilter::whereUserId($pid)
|
$filters = UserFilter::whereUserId($pid)
|
||||||
->whereFilterableType('App\Profile')
|
->whereFilterableType('App\Profile')
|
||||||
->whereIn('filter_type', ['mute', 'block'])
|
->whereIn('filter_type', ['mute', 'block'])
|
||||||
->pluck('filterable_id')->toArray();
|
->pluck('filterable_id')->toArray();
|
||||||
});
|
$filtered = array_merge($private->toArray(), $filters);
|
||||||
$private = Profile::whereIsPrivate(true)->pluck('id');
|
|
||||||
$filtered = array_merge($private->toArray(), $filtered);
|
|
||||||
$timeline = Status::whereHas('media')
|
$timeline = Status::whereHas('media')
|
||||||
->whereNotIn('profile_id', $filtered)
|
->whereNotIn('profile_id', $filtered)
|
||||||
->whereNull('in_reply_to_id')
|
->whereNull('in_reply_to_id')
|
||||||
|
|
Loading…
Reference in a new issue