1
0
Fork 0
forked from mirror/pixelfed

Update FederationController, fix outbox

This commit is contained in:
Daniel Supernault 2022-12-09 05:06:47 -07:00
parent a9d588e15e
commit e08869cbfc
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -118,20 +118,18 @@ class FederationController extends Controller
public function userOutbox(Request $request, $username) public function userOutbox(Request $request, $username)
{ {
abort_if(!config_cache('federation.activitypub.enabled'), 404); abort_if(!config_cache('federation.activitypub.enabled'), 404);
abort_if(!config('federation.activitypub.outbox'), 404);
// $profile = Profile::whereNull('domain') if(!$request->wantsJson()) {
// ->whereNull('status') return redirect('/' . $username);
// ->whereIsPrivate(false) }
// ->whereUsername($username)
// ->firstOrFail();
// $key = 'ap:outbox:latest_10:pid:' . $profile->id; $res = [
// $ttl = now()->addMinutes(15); '@context' => 'https://www.w3.org/ns/activitystreams',
// $res = Cache::remember($key, $ttl, function() use($profile) { 'id' => 'https://' . config('pixelfed.domain.app') . '/users/' . $username . '/outbox',
// return Outbox::get($profile); 'type' => 'OrderedCollection',
// }); 'totalItems' => 0,
$res = []; 'orderedItems' => []
];
return response(json_encode($res, JSON_UNESCAPED_SLASHES))->header('Content-Type', 'application/ld+json; profile="http://www.w3.org/ns/activitystreams"'); return response(json_encode($res, JSON_UNESCAPED_SLASHES))->header('Content-Type', 'application/ld+json; profile="http://www.w3.org/ns/activitystreams"');
} }