Using the same function for display and objects
This commit is contained in:
parent
39ce33f7ed
commit
9d8eca2287
|
@ -22,6 +22,7 @@ use Friendica\Model\Profile;
|
||||||
use Friendica\Protocol\ActivityPub;
|
use Friendica\Protocol\ActivityPub;
|
||||||
use Friendica\Protocol\DFRN;
|
use Friendica\Protocol\DFRN;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
use Friendica\Module\Objects;
|
||||||
|
|
||||||
function display_init(App $a)
|
function display_init(App $a)
|
||||||
{
|
{
|
||||||
|
@ -82,16 +83,7 @@ function display_init(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActivityPub::isRequest()) {
|
if (ActivityPub::isRequest()) {
|
||||||
$item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]);
|
Objects::rawContent();
|
||||||
if (!DBA::isResult($item)) {
|
|
||||||
System::httpExit(404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = ActivityPub\Transmitter::createObjectFromItemID($item['id']);
|
|
||||||
|
|
||||||
header('Content-Type: application/activity+json');
|
|
||||||
echo json_encode($data);
|
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item["id"] != $item["parent"]) {
|
if ($item["id"] != $item["parent"]) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user