1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

Update TimelineController

This commit is contained in:
Daniel Supernault 2018-08-09 23:01:01 -06:00
parent f30542ffff
commit 1fb532995a
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -18,24 +18,23 @@ class TimelineController extends Controller
// TODO: Use redis for timelines // TODO: Use redis for timelines
$following = Follower::whereProfileId(Auth::user()->profile->id)->pluck('following_id'); $following = Follower::whereProfileId(Auth::user()->profile->id)->pluck('following_id');
$following->push(Auth::user()->profile->id); $following->push(Auth::user()->profile->id);
$timeline = Status::whereHas('media') $timeline = Status::whereIn('profile_id', $following)
->whereNull('in_reply_to_id')
->whereIn('profile_id', $following)
->orderBy('id','desc') ->orderBy('id','desc')
->withCount(['comments', 'likes']) ->simplePaginate(20);
->simplePaginate(10); $type = 'personal';
return view('timeline.personal', compact('timeline')); return view('timeline.template', compact('timeline', 'type'));
} }
public function local() public function local()
{ {
// TODO: Use redis for timelines // TODO: Use redis for timelines
// $timeline = Timeline::build()->local();
$timeline = Status::whereHas('media') $timeline = Status::whereHas('media')
->whereNull('in_reply_to_id') ->whereNull('in_reply_to_id')
->orderBy('id','desc') ->orderBy('id','desc')
->withCount(['comments', 'likes']) ->simplePaginate(20);
->simplePaginate(10); $type = 'local';
return view('timeline.public', compact('timeline')); return view('timeline.template', compact('timeline', 'type'));
} }
} }