]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub.php
AP: Support "discoverable"
[friendica.git] / src / Protocol / ActivityPub.php
index 0b4810627d0eeb9cd43ee8cec4c8f97c4e87115d..134f69f4a66fd9a6d45c39cfdb063e734840471f 100644 (file)
@@ -60,14 +60,16 @@ use Friendica\Util\JsonLD;
 class ActivityPub
 {
        const PUBLIC_COLLECTION = 'https://www.w3.org/ns/activitystreams#Public';
-       const CONTEXT = ['https://www.w3.org/ns/activitystreams',
+       const CONTEXT = ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
                ['vcard' => 'http://www.w3.org/2006/vcard/ns#',
                'dfrn' => '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
@@ -151,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']
@@ -165,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)) {