Update per the master branch

This commit is contained in:
Diogo Cordeiro 2018-05-05 01:31:25 +01:00
parent aea8915903
commit 3161b62b5d

View File

@ -35,33 +35,34 @@ class Activitypub_profile extends Managed_DataObject
public static function profileToObject($profile) public static function profileToObject($profile)
{ {
$res = [ $url = $profile->getURL ();
'@context' => [ $res = [
"https://www.w3.org/ns/activitystreams", '@context' => [
[ "https://www.w3.org/ns/activitystreams",
"@language" => "en" [
] "@language" => "en"
],
'id' => $profile->getID(),
'type' => 'Person',
'nickname' => $profile->getNickname (),
'is_local' => $profile->isLocal(),
'inbox' => "{$url}/inbox.json",
'outbox' => "{$url}/outbox.json",
'display_name' => $profile->getFullname(),
'followers' => "{$url}/subscribers",
'following' => "{$url}/subscriptions",
'liked' => "{$url}/liked.json",
'liked_count' => Fave::countByProfile ($profile),
'summary' => $profile->getDescription(),
'url' => $profile->getURL(),
'avatar' => [
'type' => 'Image',
'width' => 96,
'height' => 96,
'url' => $profile->avatarUrl(AVATAR_PROFILE_SIZE)
] ]
]; ],
'id' => $profile->getID(),
'type' => 'Person',
'nickname' => $profile->getNickname (),
'is_local' => $profile->isLocal(),
'inbox' => "{$url}/inbox.json",
'outbox' => "{$url}/outbox.json",
'display_name' => $profile->getFullname(),
'followers' => "{$url}/followers.json",
'following' => "{$url}/following.json",
'liked' => "{$url}/liked.json",
'liked_count' => Fave::countByProfile ($profile),
'summary' => $profile->getDescription(),
'url' => $profile->getURL(),
'avatar' => [
'type' => 'Image',
'width' => 96,
'height' => 96,
'url' => $profile->avatarUrl(AVATAR_PROFILE_SIZE)
]
];
return $res; return $res;
} }
} }