X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub.php;h=134f69f4a66fd9a6d45c39cfdb063e734840471f;hb=e519b782fd2180d326ffbd9fc8f1d6fca111ce98;hp=45279576b7aaae56dbf0316863a71ef898e3c9cf;hpb=1414d43597b89817acc76787b502eaeb58e4876d;p=friendica.git diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index 45279576b7..134f69f4a6 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -1,6 +1,6 @@ 'http://purl.org/macgirvin/dfrn/1.0/', 'diaspora' => 'https://diasporafoundation.org/ns/', 'litepub' => 'http://litepub.social/ns#', + 'toot' => 'http://joinmastodon.org/ns#', 'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers', 'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag', - 'directMessage' => 'litepub:directMessage']]; + 'directMessage' => 'litepub:directMessage', + 'discoverable' => 'toot:discoverable']]; const ACCOUNT_TYPES = ['Person', 'Organization', 'Service', 'Group', 'Application', 'Tombstone']; /** * Checks if the web request is done for the AP protocol @@ -77,6 +79,7 @@ class ActivityPub public static function isRequest() { return stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/activity+json') || + stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/json') || stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/ld+json'); } @@ -150,6 +153,7 @@ class ActivityPub $profile['outbox'] = $apcontact['outbox']; $profile['sharedinbox'] = $apcontact['sharedinbox']; $profile['photo'] = $apcontact['photo']; + $profile['header'] = $apcontact['header']; $profile['account-type'] = self::getAccountType($apcontact); $profile['community'] = ($profile['account-type'] == User::ACCOUNT_TYPE_COMMUNITY); // $profile['keywords'] @@ -164,6 +168,10 @@ class ActivityPub $profile['baseurl'] = $apcontact['baseurl']; $profile['gsid'] = $apcontact['gsid']; + if (!is_null($apcontact['discoverable'])) { + $profile['hide'] = !$apcontact['discoverable']; + } + // Remove all "null" fields foreach ($profile as $field => $content) { if (is_null($content)) {