]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
all endpoints are now working
[friendica.git] / mod / display.php
index 907bf8ebba50d16b54ff34e341fe56c9e3da9408..ff98e689d38b2aac51274a2b0b1f80357b48e2b7 100644 (file)
@@ -17,6 +17,7 @@ use Friendica\Model\Group;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
 use Friendica\Protocol\DFRN;
+use Friendica\Protocol\ActivityPub;
 
 function display_init(App $a)
 {
@@ -43,7 +44,7 @@ function display_init(App $a)
 
        $item = null;
 
-       $fields = ['id', 'parent', 'author-id', 'body', 'uid'];
+       $fields = ['id', 'parent', 'author-id', 'body', 'uid', 'guid'];
 
        // If there is only one parameter, then check if this parameter could be a guid
        if ($a->argc == 2) {
@@ -76,6 +77,14 @@ function display_init(App $a)
                displayShowFeed($item["id"], false);
        }
 
+       if (ActivityPub::isRequest()) {
+               $wall_item = Item::selectFirst(['id', 'uid'], ['guid' => $item['guid'], 'wall' => true]);
+               if (DBA::isResult($wall_item)) {
+                       $data = ActivityPub::createObjectFromItemID($wall_item['id']);
+                       echo json_encode($data);
+                       exit();
+               }
+       }
        if ($item["id"] != $item["parent"]) {
                $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $item["parent"]]);
        }