1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 01:05:36 +00:00

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(); $user = Profile::whereUsername($username)->firstOrFail();
if($user->status != null) {
return ProfileController::accountCheck($user);
}
$status = Status::whereProfileId($user->id) $status = Status::whereProfileId($user->id)
->whereNotIn('visibility',['draft','direct']) ->whereNotIn('visibility',['draft','direct'])
->findOrFail($id); ->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($status->visibility == 'private' || $user->is_private) {
if(!Auth::check()) { if(!Auth::check()) {
abort(403); abort(403);