mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 14:03:16 +00:00
Update ProfileController
This commit is contained in:
parent
2f44cafbf0
commit
7654205408
1 changed files with 3 additions and 1 deletions
|
@ -237,10 +237,12 @@ class ProfileController extends Controller
|
||||||
abort_if(!config('instance.stories.enabled') || !$request->user(), 404);
|
abort_if(!config('instance.stories.enabled') || !$request->user(), 404);
|
||||||
$profile = Profile::whereNull('domain')->whereUsername($username)->firstOrFail();
|
$profile = Profile::whereNull('domain')->whereUsername($username)->firstOrFail();
|
||||||
$pid = $profile->id;
|
$pid = $profile->id;
|
||||||
|
$authed = Auth::user()->profile;
|
||||||
|
abort_if($pid != $authed->id && $profile->followedBy($authed) == false, 404);
|
||||||
$exists = Story::whereProfileId($pid)
|
$exists = Story::whereProfileId($pid)
|
||||||
->where('expires_at', '>', now())
|
->where('expires_at', '>', now())
|
||||||
->count();
|
->count();
|
||||||
abort_unless($exists > 1, 404);
|
abort_unless($exists > 0, 404);
|
||||||
return view('profile.story', compact('pid'));
|
return view('profile.story', compact('pid'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue