mirror of
https://github.com/friendica/friendica
synced 2025-04-26 11:50:11 +00:00
AP: Support "discoverable"
This commit is contained in:
parent
4308cace68
commit
e2dc36a691
6 changed files with 44 additions and 32 deletions
|
@ -325,7 +325,7 @@ class Transmitter
|
|||
return [];
|
||||
}
|
||||
|
||||
$fields = ['locality', 'region', 'country-name'];
|
||||
$fields = ['locality', 'region', 'country-name', 'net-publish'];
|
||||
$profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]);
|
||||
if (!DBA::isResult($profile)) {
|
||||
return [];
|
||||
|
@ -340,7 +340,7 @@ class Transmitter
|
|||
$contact = User::getSystemAccount();
|
||||
$user = ['guid' => '', 'nickname' => $contact['nick'], 'pubkey' => $contact['pubkey'],
|
||||
'account-type' => $contact['contact-type'], 'page-flags' => User::PAGE_FLAGS_NORMAL];
|
||||
$profile = ['locality' => '', 'region' => '', 'country-name' => ''];
|
||||
$profile = ['locality' => '', 'region' => '', 'country-name' => '', 'net-publish' => false];
|
||||
}
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT];
|
||||
|
@ -375,6 +375,7 @@ class Transmitter
|
|||
|
||||
$data['url'] = $contact['url'];
|
||||
$data['manuallyApprovesFollowers'] = in_array($user['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP]);
|
||||
$data['discoverable'] = $profile['net-publish'];
|
||||
$data['publicKey'] = ['id' => $contact['url'] . '#main-key',
|
||||
'owner' => $contact['url'],
|
||||
'publicKeyPem' => $user['pubkey']];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue