Update ProfileController

pull/1906/head
Daniel Supernault 2020-01-05 21:52:40 -07:00
rodzic 2f44cafbf0
commit 7654205408
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -237,10 +237,12 @@ class ProfileController extends Controller
abort_if(!config('instance.stories.enabled') || !$request->user(), 404);
$profile = Profile::whereNull('domain')->whereUsername($username)->firstOrFail();
$pid = $profile->id;
$authed = Auth::user()->profile;
abort_if($pid != $authed->id && $profile->followedBy($authed) == false, 404);
$exists = Story::whereProfileId($pid)
->where('expires_at', '>', now())
->count();
abort_unless($exists > 1, 404);
abort_unless($exists > 0, 404);
return view('profile.story', compact('pid'));
}
}