From 95fd0a75c45e2dff96c4abfc9885b727a30eca54 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Sat, 5 May 2018 01:32:27 +0100 Subject: [PATCH] Update endpoint URLs and lack of variable declaration fix --- classes/Activitypub_profile.php | 53 +++++++++++++++++---------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/classes/Activitypub_profile.php b/classes/Activitypub_profile.php index bbd560d..59978bf 100644 --- a/classes/Activitypub_profile.php +++ b/classes/Activitypub_profile.php @@ -35,33 +35,34 @@ class Activitypub_profile extends Managed_DataObject public static function profileToObject($profile) { - $res = [ - '@context' => [ - "https://www.w3.org/ns/activitystreams", - [ - "@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) + $url = $profile->getURL (); + $res = [ + '@context' => [ + "https://www.w3.org/ns/activitystreams", + [ + "@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}/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; } }