if (ActivityPub::isRequest()) {
$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']);
echo json_encode($data);
exit();
// This is just a precaution if maybe this page is called somewhere directly via POST
$_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['message']) {
if (ActivityPub::isRequest()) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $which]);
- if ($user['uid'] == 180) {
+ if (DBM::isResult($user)) {
$data = ActivityPub::profile($user['uid']);
echo json_encode($data);
exit();
['rel' => NAMESPACE_DFRN, 'href' => $profile_url],
['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' => 'self', 'type' => 'application/activity+json', 'href' => $profile_url],
['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' => 'http://webfinger.net/rel/avatar', 'type' => 'image/jpeg', 'href' => System::baseUrl().'/photo/profile/'.$r['uid'].'.jpg'],
['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);
killme();
$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)) {
$data = $ap_profile;
}
}
$data = ['@context' => ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
- ['ostatus' => 'http://ostatus.org#', 'sensitive' => 'as:sensitive',
- 'Hashtag' => 'as:Hashtag', 'atomUri' => 'ostatus:atomUri',
- 'conversation' => 'ostatus:conversation',
+ ['ostatus' => 'http://ostatus.org#', 'uuid' => 'http://schema.org/identifier',
+ 'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag',
+ 'atomUri' => 'ostatus:atomUri', 'conversation' => 'ostatus:conversation',
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri']]];
$data['id'] = $item['uri'] . '#activity';
}
$data = ['@context' => ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
- ['ostatus' => 'http://ostatus.org#', 'sensitive' => 'as:sensitive',
- 'Hashtag' => 'as:Hashtag', 'atomUri' => 'ostatus:atomUri',
- 'conversation' => 'ostatus:conversation',
+ ['ostatus' => 'http://ostatus.org#', 'uuid' => 'http://schema.org/identifier',
+ 'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag',
+ 'atomUri' => 'ostatus:atomUri', 'conversation' => 'ostatus:conversation',
'inReplyToAtomUri' => 'ostatus:inReplyToAtomUri']]];
$data = array_merge($data, self::CreateNote($item));
$data['inReplyTo'] = null;
}
+ $data['uuid'] = $item['guid'];
$data['published'] = DateTimeFormat::utc($item["created"]."+00:00", DateTimeFormat::ATOM);
if ($item["created"] != $item["edited"]) {