ActivityPub: Little cleanup

This commit is contained in:
veselcraft 2022-02-11 17:12:37 +03:00
parent c2dffb3949
commit c9aca1f3c5
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E
3 changed files with 4 additions and 8 deletions

View file

@ -7,10 +7,10 @@ final class ActivityPubPresenter extends OpenVKPresenter
function renderWellKnown(): void
{
if ($_SERVER['REQUEST_URI'] == "/.well-known/host-meta") {
$data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
. "<XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\">\n"
. " <Link rel=\"lrdd\" template=\"" . ovk_scheme(true) . $_SERVER["SERVER_NAME"] . "/.well-known/webfinger?resource={uri}\">\n"
. "</XRD>\n";
$data = '<?xml version="1.0" encoding="UTF-8"?>'
. '<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">'
. '<Link rel="lrdd" template="' . ovk_scheme(true) . $_SERVER["SERVER_NAME"] . '/.well-known/webfinger?resource={uri}"/>'
. '</XRD>';
header("Content-Type: application/xrd+xml; charset=utf-8");
exit($data);

View file

@ -301,8 +301,6 @@ abstract class OpenVKPresenter extends SimplePresenter
"@id": "sm:groups",
"@type": "@id"
},
"verified": "sm:verified",
"status": "sm:status",
"vcard": "http://www.w3.org/2006/vcard/ns#"
},
"https://w3id.org/security/v1"

View file

@ -57,8 +57,6 @@ final class UserPresenter extends OpenVKPresenter
"middleName" => $user->getPseudo(), // Unlike Smithereen, the Middle name in OpenVK is a Nickname
"vcard:bday" => $user->getBirthday()->format('%Y-%m-%d'),
"gender" => "http://schema.org#" . $user->isFemale() ? "Male" : "Female",
"verified" => $user->isVerified(),
"status" => $user->getStatus(),
"supportsFriendRequests" => true,
"friends" => ovk_scheme(true) . $_SERVER['SERVER_NAME'] . "/friends" . $user->getId(),
"groups" => ovk_scheme(true) . $_SERVER['SERVER_NAME'] . "/groups" . $user->getId()