Update InternalApiController, redirect remote post and profiles to Metro 2.0

This commit is contained in:
Daniel Supernault 2022-01-25 02:18:50 -07:00
parent 16e725183e
commit 3c35158ebc
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -410,26 +410,12 @@ class InternalApiController extends Controller
public function remoteProfile(Request $request, $id)
{
$profile = Profile::whereNull('status')
->whereNotNull('domain')
->findOrFail($id);
$user = Auth::user();
return view('profile.remote', compact('profile', 'user'));
return redirect('/i/web/profile/' . $id);
}
public function remoteStatus(Request $request, $profileId, $statusId)
{
$user = Profile::whereNull('status')
->whereNotNull('domain')
->findOrFail($profileId);
$status = Status::whereProfileId($user->id)
->whereNull('reblog_of_id')
->whereIn('visibility', ['public', 'unlisted'])
->findOrFail($statusId);
$template = $status->in_reply_to_id ? 'status.reply' : 'status.remote';
return view($template, compact('user', 'status'));
return redirect('/i/web/post/' . $statusId);
}
public function requestEmailVerification(Request $request)