From c2dffb39495f659219b361201858c714e9df68ed Mon Sep 17 00:00:00 2001 From: veselcraft Date: Thu, 6 Jan 2022 15:57:00 +0300 Subject: [PATCH] ActivityPub: Forgot to add followers and following --- Web/Presenters/UserPresenter.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Web/Presenters/UserPresenter.php b/Web/Presenters/UserPresenter.php index 708e3675..54e0b051 100644 --- a/Web/Presenters/UserPresenter.php +++ b/Web/Presenters/UserPresenter.php @@ -35,7 +35,6 @@ final class UserPresenter extends OpenVKPresenter /* ActivityPub quirks :DDDD */ if($this->isActivityPubClient()) { $objUser = array( - "@context" => $this->getPersonContext(), "type" => "Person", "id" => $user->getFullURL(true), "name" => $user->getFullName(), @@ -44,7 +43,9 @@ final class UserPresenter extends OpenVKPresenter "prefferedUsername" => $user->getShortCode(), "inbox" => $user->getFullURL() . "/inbox", "outbox" => $user->getFullURL() . "/outbox", - "endpoints" => array("sharedInbox" => ovk_scheme(true) . $_SERVER['SERVER_NAME']), + "followers" => ovk_scheme(true) . $_SERVER['SERVER_NAME'] . "/friends" . $user->getId() . '?act=incoming', + "following" => ovk_scheme(true) . $_SERVER['SERVER_NAME'] . "/friends" . $user->getId() . '?act=outcoming', + "endpoints" => array("sharedInbox" => ovk_scheme(true) . $_SERVER['SERVER_NAME'] . "/activitypub/sharedInbox"), "publicKey" => array( "id" => $user->getFullURL(true) . "#main-key", "owner" => $user->getFullURL(true), @@ -70,6 +71,8 @@ final class UserPresenter extends OpenVKPresenter "url" => $user->getAvatarUrl(true) ); } + + $objUser['@context'] = $this->getPersonContext(); $this->returnJson($objUser, CT_AP); }