Add following/followers to ActivityPubActor action

This commit is contained in:
Daniel Supernault 2018-03-25 14:55:14 -06:00
parent d44a5974da
commit 839e1f01af
1 changed files with 12 additions and 6 deletions

View File

@ -38,21 +38,27 @@ class ActivityPubActorAction extends ManagedAction
{ {
$user = User::getByID($this->trimmed('id')); $user = User::getByID($this->trimmed('id'));
$profile = $user->getProfile(); $profile = $user->getProfile();
$url = $profile->profileurl;
$res = [ $res = [
'@context' => ["https://www.w3.org/ns/activitystreams"], '@context' => [
'id' => $profile->profileurl, "https://www.w3.org/ns/activitystreams",
[
"@language" => "en"
]
],
'id' => $url,
'type' => 'Person', 'type' => 'Person',
'following' => null, 'following' => "{$url}/subscriptions",
'followers' => null, 'followers' => "{$url}/subscribers",
'inbox' => null, 'inbox' => null,
'outbox' => null, 'outbox' => null,
'liked' => null, 'liked' => "{$url}/favorites",
'featured' => null, 'featured' => null,
'preferredUsername' => $user->nickname, 'preferredUsername' => $user->nickname,
'name' => $user->nickname, 'name' => $user->nickname,
'summary' => $profile->bio, 'summary' => $profile->bio,
'url' => $profile->profileurl 'url' => $url
]; ];
header('Content-Type: application/json'); header('Content-Type: application/json');