New uri format for our posts that is AP compatible
This commit is contained in:
parent
2e7ca76e15
commit
fb5b6e4a14
|
@ -2329,13 +2329,7 @@ class Item extends BaseObject
|
||||||
$guid = System::createGUID(32);
|
$guid = System::createGUID(32);
|
||||||
}
|
}
|
||||||
|
|
||||||
$hostname = self::getApp()->get_hostname();
|
return self::getApp()->get_baseurl() . '/object/' . $guid;
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $uid]);
|
|
||||||
|
|
||||||
$uri = "urn:X-dfrn:" . $hostname . ':' . $user['nickname'] . ':' . $guid;
|
|
||||||
|
|
||||||
return $uri;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1592,17 +1592,13 @@ class Diaspora
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
return $item["uri"];
|
return $item["uri"];
|
||||||
} elseif (!$onlyfound) {
|
} elseif (!$onlyfound) {
|
||||||
$contact = Contact::getDetailsByAddr($author, 0);
|
$person = self::personByHandle($author);
|
||||||
if (!empty($contact['network'])) {
|
|
||||||
$prefix = 'urn:X-' . $contact['network'] . ':';
|
|
||||||
} else {
|
|
||||||
// This fallback should happen most unlikely
|
|
||||||
$prefix = 'urn:X-dspr:';
|
|
||||||
}
|
|
||||||
|
|
||||||
$author_parts = explode('@', $author);
|
$parts = parse_url($person['url']);
|
||||||
|
unset($parts['path']);
|
||||||
|
$host_url = Network::unparseURL($parts);
|
||||||
|
|
||||||
return $prefix . $author_parts[1] . ':' . $author_parts[0] . ':'. $guid;
|
return $host_url . '/object/' . $guid;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user