]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Merge pull request #8888 from annando/rename-keywordlist
[friendica.git] / mod / display.php
index 9ab25a96b4d2cd5ac74f678693cc661ef2879ca8..1a429948a9d8de8ae2342c03da49910bf4ec47a0 100644 (file)
@@ -54,7 +54,7 @@ function display_init(App $a)
        $item = null;
        $item_user = local_user();
 
-       $fields = ['id', 'parent', 'author-id', 'body', 'uid', 'guid'];
+       $fields = ['id', 'parent', 'author-id', 'body', 'uid', 'guid', 'gravity'];
 
        // If there is only one parameter, then check if this parameter could be a guid
        if ($a->argc == 2) {
@@ -101,12 +101,12 @@ function display_init(App $a)
        }
 
        if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
-               Logger::log('Directly serving XML for id '.$item["id"], Logger::DEBUG);
-               displayShowFeed($item["id"], false);
+               Logger::log('Directly serving XML for id '.$item['id'], Logger::DEBUG);
+               displayShowFeed($item['id'], false);
        }
 
-       if ($item["id"] != $item["parent"]) {
-               $parent = Item::selectFirstForUser($item_user, $fields, ['id' => $item["parent"]]);
+       if ($item['gravity'] != GRAVITY_PARENT) {
+               $parent = Item::selectFirstForUser($item_user, $fields, ['id' => $item['parent']]);
                $item = $parent ?: $item;
        }
 
@@ -164,7 +164,7 @@ function display_fetchauthor($a, $item)
                $profiledata["about"] = "";
        }
 
-       $profiledata = Contact::getDetailsByURL($profiledata["url"], local_user(), $profiledata);
+       $profiledata = Contact::getByURLForUser($profiledata["url"], local_user()) ?: $profiledata;
 
        if (!empty($profiledata["photo"])) {
                $profiledata["photo"] = DI::baseUrl()->remove($profiledata["photo"]);
@@ -207,8 +207,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
                                $condition = ['guid' => $a->argv[1], 'uid' => local_user()];
                                $item = Item::selectFirstForUser(local_user(), $fields, $condition);
                                if (DBA::isResult($item)) {
-                                       $item_id = $item["id"];
-                                       $item_parent = $item["parent"];
+                                       $item_id = $item['id'];
+                                       $item_parent = $item['parent'];
                                        $item_parent_uri = $item['parent-uri'];
                                }
                        }
@@ -216,8 +216,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
                        if (($item_parent == 0) && remote_user()) {
                                $item = Item::selectFirst($fields, ['guid' => $a->argv[1], 'private' => Item::PRIVATE, 'origin' => true]);
                                if (DBA::isResult($item) && Contact::isFollower(remote_user(), $item['uid'])) {
-                                       $item_id = $item["id"];
-                                       $item_parent = $item["parent"];
+                                       $item_id = $item['id'];
+                                       $item_parent = $item['parent'];
                                        $item_parent_uri = $item['parent-uri'];
                                }
                        }
@@ -226,8 +226,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
                                $condition = ['private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $a->argv[1], 'uid' => 0];
                                $item = Item::selectFirstForUser(local_user(), $fields, $condition);
                                if (DBA::isResult($item)) {
-                                       $item_id = $item["id"];
-                                       $item_parent = $item["parent"];
+                                       $item_id = $item['id'];
+                                       $item_parent = $item['parent'];
                                        $item_parent_uri = $item['parent-uri'];
                                }
                        }