X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub.php;h=a34854152254862a50235760e55f76fe329ffb3f;hb=763e26419636a5dbb107e893ddf4f04b2156fc6d;hp=0b4810627d0eeb9cd43ee8cec4c8f97c4e87115d;hpb=6f2fcd2859fe57446f39b44ad5ccac76839be57a;p=friendica.git diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index 0b4810627d..a348541522 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -22,8 +22,6 @@ namespace Friendica\Protocol; use Friendica\Core\Protocol; -use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\APContact; use Friendica\Model\User; use Friendica\Util\HTTPSignature; @@ -60,14 +58,20 @@ 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#', + 'schema' => 'http://schema.org#', 'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers', 'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag', - 'directMessage' => 'litepub:directMessage']]; + 'directMessage' => 'litepub:directMessage', + 'discoverable' => 'toot:discoverable', + 'PropertyValue' => 'schema:PropertyValue', + 'value' => 'schema:value', + ]]; const ACCOUNT_TYPES = ['Person', 'Organization', 'Service', 'Group', 'Application', 'Tombstone']; /** * Checks if the web request is done for the AP protocol @@ -151,11 +155,14 @@ 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'] // $profile['location'] $profile['about'] = $apcontact['about']; + $profile['xmpp'] = $apcontact['xmpp']; + $profile['matrix'] = $apcontact['matrix']; $profile['batch'] = $apcontact['sharedinbox']; $profile['notify'] = $apcontact['inbox']; $profile['poll'] = $apcontact['outbox']; @@ -165,6 +172,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)) {