Update StatusController

This commit is contained in:
Daniel Supernault 2019-11-22 23:35:13 -07:00
parent d2c53dc56a
commit 98ad593654
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -51,6 +51,12 @@ class StatusController extends Controller
} }
} }
if($status->type == 'archived') {
if(Auth::user()->profile_id !== $status->profile_id) {
abort(404);
}
}
if ($request->wantsJson() && config('federation.activitypub.enabled')) { if ($request->wantsJson() && config('federation.activitypub.enabled')) {
return $this->showActivityPub($request, $status); return $this->showActivityPub($request, $status);
} }
@ -72,7 +78,7 @@ class StatusController extends Controller
{ {
abort(404); abort(404);
$profile = Profile::whereNull('status')->whereUsername($username)->first(); $profile = Profile::whereNull('status')->whereUsername($username)->first();
$status = Status::whereScope('private')->find($id); $status = Status::whereProfileId($profile->id)->whereScope('public')->find($id);
if(!$profile || !$status) { if(!$profile || !$status) {
return view('status.embed-removed'); return view('status.embed-removed');
} }