Add remote posts and profiles

This commit is contained in:
Daniel Supernault 2020-04-08 21:34:31 -06:00
parent 9d7a04e89b
commit 95bce31e62
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
9 changed files with 1479 additions and 22 deletions

View file

@ -343,27 +343,6 @@ class InternalApiController extends Controller
return response()->json($res);
}
public function remoteProfile(Request $request, $id)
{
$profile = Profile::whereNull('status')
->whereNotNull('domain')
->findOrFail($id);
$settings = [
'crawlable' => false,
'following' => [
'count' => true,
'list' => false
],
'followers' => [
'count' => true,
'list' => false
]
];
return view('profile.show', compact('profile', 'settings'));
}
public function accountStatuses(Request $request, $id)
{
$this->validate($request, [
@ -440,6 +419,15 @@ class InternalApiController extends Controller
return response()->json($res);
}
public function remoteProfile(Request $request, $id)
{
$profile = Profile::whereNull('status')
->findOrFail($id);
$user = Auth::user();
return view('profile.remote', compact('profile', 'user'));
}
public function remoteStatus(Request $request, $profileId, $statusId)
{
$user = Profile::whereNull('status')
@ -450,7 +438,7 @@ class InternalApiController extends Controller
->whereNull('reblog_of_id')
->whereVisibility('public')
->findOrFail($statusId);
$template = $status->in_reply_to_id ? 'status.reply' : 'status.show';
$template = $status->in_reply_to_id ? 'status.reply' : 'status.remote';
return view($template, compact('user', 'status'));
}
}