mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 17:53:16 +00:00
Update AP ProfileTransformer
This commit is contained in:
parent
985938b662
commit
7f789ad508
1 changed files with 11 additions and 4 deletions
|
@ -11,7 +11,14 @@ class ProfileTransformer extends Fractal\TransformerAbstract
|
||||||
public function transform(Profile $profile)
|
public function transform(Profile $profile)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
'@context' => [
|
||||||
|
'https://www.w3.org/ns/activitystreams',
|
||||||
|
'https://w3id.org/security/v1',
|
||||||
|
[
|
||||||
|
"manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
|
||||||
|
"featured" => 'https://pixelfed.org/ns/featured',
|
||||||
|
]
|
||||||
|
],
|
||||||
'id' => $profile->permalink(),
|
'id' => $profile->permalink(),
|
||||||
'type' => 'Person',
|
'type' => 'Person',
|
||||||
'following' => $profile->permalink('/following'),
|
'following' => $profile->permalink('/following'),
|
||||||
|
@ -23,9 +30,9 @@ class ProfileTransformer extends Fractal\TransformerAbstract
|
||||||
'name' => $profile->name,
|
'name' => $profile->name,
|
||||||
'summary' => $profile->bio,
|
'summary' => $profile->bio,
|
||||||
'url' => $profile->url(),
|
'url' => $profile->url(),
|
||||||
'manuallyApprovesFollowers' => $profile->is_private,
|
'manuallyApprovesFollowers' => (bool) $profile->is_private,
|
||||||
'follower_count' => $profile->followers()->count(),
|
// 'follower_count' => $profile->followers()->count(),
|
||||||
'following_count' => $profile->following()->count(),
|
// 'following_count' => $profile->following()->count(),
|
||||||
'publicKey' => [
|
'publicKey' => [
|
||||||
'id' => $profile->permalink() . '#main-key',
|
'id' => $profile->permalink() . '#main-key',
|
||||||
'owner' => $profile->permalink(),
|
'owner' => $profile->permalink(),
|
||||||
|
|
Loading…
Reference in a new issue