1
0
Fork 0
forked from mirror/pixelfed

Update FederationController

This commit is contained in:
Daniel Supernault 2018-09-01 23:55:55 -06:00
parent 223fae10e2
commit 7125f803a7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -140,7 +140,10 @@ class FederationController extends Controller
}
$user = Profile::whereNull('remote_url')->whereUsername($username)->firstOrFail();
$timeline = $user->statuses()->orderBy('created_at', 'desc')->paginate(10);
if($user->is_private) {
return response()->json(['error'=>'403', 'msg' => 'private profile'], 403);
}
$timeline = $user->statuses()->whereVisibility('public')->orderBy('created_at', 'desc')->paginate(10);
$fractal = new Fractal\Manager();
$resource = new Fractal\Resource\Item($user, new ProfileOutbox());
$res = $fractal->createData($resource)->toArray();