AP: Support "discoverable"

This commit is contained in:
Michael 2021-06-30 05:40:11 +00:00
parent 4308cace68
commit e2dc36a691
6 changed files with 44 additions and 32 deletions

View 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)) {