Using the same function for display and objects

This commit is contained in:
Michael 2018-11-29 22:42:10 +00:00
parent 39ce33f7ed
commit 9d8eca2287

View file

@ -22,6 +22,7 @@ use Friendica\Model\Profile;
use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\DFRN;
use Friendica\Util\Strings;
use Friendica\Module\Objects;
function display_init(App $a)
{
@ -82,16 +83,7 @@ function display_init(App $a)
}
if (ActivityPub::isRequest()) {
$item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]);
if (!DBA::isResult($item)) {
System::httpExit(404);
}
$data = ActivityPub\Transmitter::createObjectFromItemID($item['id']);
header('Content-Type: application/activity+json');
echo json_encode($data);
exit();
Objects::rawContent();
}
if ($item["id"] != $item["parent"]) {