Update ActivityPubActor action
This commit is contained in:
parent
cc454c2a37
commit
80bf4c1219
@ -34,20 +34,29 @@ class ActivityPubActorAction extends ManagedAction
|
|||||||
protected $needLogin = false;
|
protected $needLogin = false;
|
||||||
protected $canPost = true;
|
protected $canPost = true;
|
||||||
|
|
||||||
protected $user = false;
|
|
||||||
|
|
||||||
protected function handle()
|
protected function handle()
|
||||||
{
|
{
|
||||||
$this->user = User::getByID($this->trimmed('id'));
|
$user = User::getByID($this->trimmed('id'));
|
||||||
|
$profile = $user->getProfile();
|
||||||
|
|
||||||
$res = [
|
$res = [
|
||||||
'@context' => ["https://www.w3.org/ns/activitystreams"],
|
'@context' => ["https://www.w3.org/ns/activitystreams"],
|
||||||
'id' => $this->user->uri,
|
'id' => $profile->profileurl,
|
||||||
'type' => 'Person'
|
'type' => 'Person',
|
||||||
|
'following' => null,
|
||||||
|
'followers' => null,
|
||||||
|
'inbox' => null,
|
||||||
|
'outbox' => null,
|
||||||
|
'liked' => null,
|
||||||
|
'featured' => null,
|
||||||
|
'preferredUsername' => $user->nickname,
|
||||||
|
'name' => $user->nickname,
|
||||||
|
'summary' => $profile->bio,
|
||||||
|
'url' => $profile->profileurl
|
||||||
];
|
];
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
echo json_encode($res, JSON_PRETTY_PRINT);
|
echo json_encode($res, JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user