ActivityPub: Forgot to add followers and following

This commit is contained in:
veselcraft 2022-01-06 15:57:00 +03:00
parent 624a2c088c
commit c2dffb3949
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E

View file

@ -35,7 +35,6 @@ final class UserPresenter extends OpenVKPresenter
/* ActivityPub quirks :DDDD */ /* ActivityPub quirks :DDDD */
if($this->isActivityPubClient()) { if($this->isActivityPubClient()) {
$objUser = array( $objUser = array(
"@context" => $this->getPersonContext(),
"type" => "Person", "type" => "Person",
"id" => $user->getFullURL(true), "id" => $user->getFullURL(true),
"name" => $user->getFullName(), "name" => $user->getFullName(),
@ -44,7 +43,9 @@ final class UserPresenter extends OpenVKPresenter
"prefferedUsername" => $user->getShortCode(), "prefferedUsername" => $user->getShortCode(),
"inbox" => $user->getFullURL() . "/inbox", "inbox" => $user->getFullURL() . "/inbox",
"outbox" => $user->getFullURL() . "/outbox", "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( "publicKey" => array(
"id" => $user->getFullURL(true) . "#main-key", "id" => $user->getFullURL(true) . "#main-key",
"owner" => $user->getFullURL(true), "owner" => $user->getFullURL(true),
@ -71,6 +72,8 @@ final class UserPresenter extends OpenVKPresenter
); );
} }
$objUser['@context'] = $this->getPersonContext();
$this->returnJson($objUser, CT_AP); $this->returnJson($objUser, CT_AP);
} }