AP is enabled for all users
This commit is contained in:
parent
ca574e1027
commit
a56565fa99
6 changed files with 14 additions and 15 deletions
|
@ -79,7 +79,7 @@ function display_init(App $a)
|
||||||
|
|
||||||
if (ActivityPub::isRequest()) {
|
if (ActivityPub::isRequest()) {
|
||||||
$wall_item = Item::selectFirst(['id', 'uid'], ['guid' => $item['guid'], 'wall' => true]);
|
$wall_item = Item::selectFirst(['id', 'uid'], ['guid' => $item['guid'], 'wall' => true]);
|
||||||
if ($wall_item['uid'] == 180) {
|
if (DBA::isResult($wall_item)) {
|
||||||
$data = ActivityPub::createObjectFromItemID($wall_item['id']);
|
$data = ActivityPub::createObjectFromItemID($wall_item['id']);
|
||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -31,8 +31,7 @@ function follow_post(App $a)
|
||||||
// This is just a precaution if maybe this page is called somewhere directly via POST
|
// This is just a precaution if maybe this page is called somewhere directly via POST
|
||||||
$_SESSION['fastlane'] = $url;
|
$_SESSION['fastlane'] = $url;
|
||||||
|
|
||||||
$result = Contact::createFromProbe($uid, $url, true, Protocol::ACTIVITYPUB);
|
$result = Contact::createFromProbe($uid, $url, true);
|
||||||
// $result = Contact::createFromProbe($uid, $url, true);
|
|
||||||
|
|
||||||
if ($result['success'] == false) {
|
if ($result['success'] == false) {
|
||||||
if ($result['message']) {
|
if ($result['message']) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ function profile_init(App $a)
|
||||||
|
|
||||||
if (ActivityPub::isRequest()) {
|
if (ActivityPub::isRequest()) {
|
||||||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $which]);
|
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $which]);
|
||||||
if ($user['uid'] == 180) {
|
if (DBM::isResult($user)) {
|
||||||
$data = ActivityPub::profile($user['uid']);
|
$data = ActivityPub::profile($user['uid']);
|
||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -80,6 +80,7 @@ function xrd_json($a, $uri, $alias, $profile_url, $r)
|
||||||
['rel' => NAMESPACE_DFRN, 'href' => $profile_url],
|
['rel' => NAMESPACE_DFRN, 'href' => $profile_url],
|
||||||
['rel' => NAMESPACE_FEED, 'type' => 'application/atom+xml', 'href' => System::baseUrl().'/dfrn_poll/'.$r['nickname']],
|
['rel' => NAMESPACE_FEED, 'type' => 'application/atom+xml', 'href' => System::baseUrl().'/dfrn_poll/'.$r['nickname']],
|
||||||
['rel' => 'http://webfinger.net/rel/profile-page', 'type' => 'text/html', 'href' => $profile_url],
|
['rel' => 'http://webfinger.net/rel/profile-page', 'type' => 'text/html', 'href' => $profile_url],
|
||||||
|
['rel' => 'self', 'type' => 'application/activity+json', 'href' => $profile_url],
|
||||||
['rel' => 'http://microformats.org/profile/hcard', 'type' => 'text/html', 'href' => System::baseUrl().'/hcard/'.$r['nickname']],
|
['rel' => 'http://microformats.org/profile/hcard', 'type' => 'text/html', 'href' => System::baseUrl().'/hcard/'.$r['nickname']],
|
||||||
['rel' => NAMESPACE_POCO, 'href' => System::baseUrl().'/poco/'.$r['nickname']],
|
['rel' => NAMESPACE_POCO, 'href' => System::baseUrl().'/poco/'.$r['nickname']],
|
||||||
['rel' => 'http://webfinger.net/rel/avatar', 'type' => 'image/jpeg', 'href' => System::baseUrl().'/photo/profile/'.$r['uid'].'.jpg'],
|
['rel' => 'http://webfinger.net/rel/avatar', 'type' => 'image/jpeg', 'href' => System::baseUrl().'/photo/profile/'.$r['uid'].'.jpg'],
|
||||||
|
@ -92,9 +93,6 @@ function xrd_json($a, $uri, $alias, $profile_url, $r)
|
||||||
['rel' => 'http://purl.org/openwebauth/v1', 'type' => 'application/x-dfrn+json', 'href' => System::baseUrl().'/owa']
|
['rel' => 'http://purl.org/openwebauth/v1', 'type' => 'application/x-dfrn+json', 'href' => System::baseUrl().'/owa']
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
if ($r['uid'] == 180) {
|
|
||||||
$json['links'][] = ['rel' => 'self', 'type' => 'application/activity+json', 'href' => $profile_url];
|
|
||||||
}
|
|
||||||
|
|
||||||
echo json_encode($json);
|
echo json_encode($json);
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -335,8 +335,9 @@ class Probe
|
||||||
$data = null;
|
$data = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array(defaults($data, 'network', ''), ['', Protocol::PHANTOM])) {
|
|
||||||
$ap_profile = ActivityPub::probeProfile($uri);
|
$ap_profile = ActivityPub::probeProfile($uri);
|
||||||
|
|
||||||
|
if (!empty($ap_profile) && (defaults($data, 'network', '') != Protocol::DFRN)) {
|
||||||
if (!empty($ap_profile) && ($ap_profile['network'] == Protocol::ACTIVITYPUB)) {
|
if (!empty($ap_profile) && ($ap_profile['network'] == Protocol::ACTIVITYPUB)) {
|
||||||
$data = $ap_profile;
|
$data = $ap_profile;
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,9 +332,9 @@ class ActivityPub
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = ['@context' => ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
|
$data = ['@context' => ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
|
||||||
['ostatus' => 'http://ostatus.org#', 'sensitive' => 'as:sensitive',
|
['ostatus' => 'http://ostatus.org#', 'uuid' => 'http://schema.org/identifier',
|
||||||
'Hashtag' => 'as:Hashtag', 'atomUri' => 'ostatus:atomUri',
|
'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag',
|
||||||
'conversation' => 'ostatus:conversation',
|
'atomUri' => 'ostatus:atomUri', 'conversation' => 'ostatus:conversation',
|
||||||
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri']]];
|
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri']]];
|
||||||
|
|
||||||
$data['id'] = $item['uri'] . '#activity';
|
$data['id'] = $item['uri'] . '#activity';
|
||||||
|
@ -372,9 +372,9 @@ class ActivityPub
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = ['@context' => ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
|
$data = ['@context' => ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
|
||||||
['ostatus' => 'http://ostatus.org#', 'sensitive' => 'as:sensitive',
|
['ostatus' => 'http://ostatus.org#', 'uuid' => 'http://schema.org/identifier',
|
||||||
'Hashtag' => 'as:Hashtag', 'atomUri' => 'ostatus:atomUri',
|
'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag',
|
||||||
'conversation' => 'ostatus:conversation',
|
'atomUri' => 'ostatus:atomUri', 'conversation' => 'ostatus:conversation',
|
||||||
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri']]];
|
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri']]];
|
||||||
|
|
||||||
$data = array_merge($data, self::CreateNote($item));
|
$data = array_merge($data, self::CreateNote($item));
|
||||||
|
@ -433,6 +433,7 @@ class ActivityPub
|
||||||
$data['inReplyTo'] = null;
|
$data['inReplyTo'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['uuid'] = $item['guid'];
|
||||||
$data['published'] = DateTimeFormat::utc($item["created"]."+00:00", DateTimeFormat::ATOM);
|
$data['published'] = DateTimeFormat::utc($item["created"]."+00:00", DateTimeFormat::ATOM);
|
||||||
|
|
||||||
if ($item["created"] != $item["edited"]) {
|
if ($item["created"] != $item["edited"]) {
|
||||||
|
|
Loading…
Reference in a new issue