]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub.php
AP: Support "discoverable"
[friendica.git] / src / Protocol / ActivityPub.php
index 6f9d7cf2485d78ecdc2015da5f99379d3c8842cf..134f69f4a66fd9a6d45c39cfdb063e734840471f 100644 (file)
@@ -65,9 +65,11 @@ class ActivityPub
                '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
@@ -166,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)) {