Update StatusController

This commit is contained in:
Daniel Supernault 2018-12-23 22:01:15 -07:00
parent 4bce09b28e
commit 9608307243
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -21,10 +21,22 @@ class StatusController extends Controller
{
$user = Profile::whereUsername($username)->firstOrFail();
if($user->status != null) {
return ProfileController::accountCheck($user);
}
$status = Status::whereProfileId($user->id)
->whereNotIn('visibility',['draft','direct'])
->findOrFail($id);
if($status->uri) {
$url = $status->uri;
if(ends_with($url, '/activity')) {
$url = str_replace('/activity', '', $url);
}
return redirect($url);
}
if($status->visibility == 'private' || $user->is_private) {
if(!Auth::check()) {
abort(403);