mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 08:44:02 +00:00
Update StatusController
This commit is contained in:
parent
540c961529
commit
cdff55313a
1 changed files with 6 additions and 3 deletions
|
@ -78,7 +78,8 @@ class StatusController extends Controller
|
||||||
{
|
{
|
||||||
$profile = Profile::whereNull(['domain','status'])->whereUsername($username)->first();
|
$profile = Profile::whereNull(['domain','status'])->whereUsername($username)->first();
|
||||||
if(!$profile) {
|
if(!$profile) {
|
||||||
return view('status.embed-removed');
|
$content = view('status.embed-removed');
|
||||||
|
return response($content)->header('X-Frame-Options', 'ALLOWALL');
|
||||||
}
|
}
|
||||||
$status = Status::whereProfileId($profile->id)
|
$status = Status::whereProfileId($profile->id)
|
||||||
->whereNull('uri')
|
->whereNull('uri')
|
||||||
|
@ -87,12 +88,14 @@ class StatusController extends Controller
|
||||||
->whereIn('type', ['photo', 'video'])
|
->whereIn('type', ['photo', 'video'])
|
||||||
->find($id);
|
->find($id);
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
return view('status.embed-removed');
|
$content = view('status.embed-removed');
|
||||||
|
return response($content)->header('X-Frame-Options', 'ALLOWALL');
|
||||||
}
|
}
|
||||||
$showLikes = $request->filled('likes') && $request->likes == true;
|
$showLikes = $request->filled('likes') && $request->likes == true;
|
||||||
$showCaption = $request->filled('caption') && $request->caption !== false;
|
$showCaption = $request->filled('caption') && $request->caption !== false;
|
||||||
$layout = $request->filled('layout') && $request->layout == 'compact' ? 'compact' : 'full';
|
$layout = $request->filled('layout') && $request->layout == 'compact' ? 'compact' : 'full';
|
||||||
return view('status.embed', compact('status', 'showLikes', 'showCaption', 'layout'));
|
$content = view('status.embed', compact('status', 'showLikes', 'showCaption', 'layout'));
|
||||||
|
return response($content)->header('X-Frame-Options', 'ALLOWALL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showObject(Request $request, $username, int $id)
|
public function showObject(Request $request, $username, int $id)
|
||||||
|
|
Loading…
Reference in a new issue