]> git.mxchange.org Git - friendica.git/blobdiff - mod/notes.php
fix return fallback to SESSION Variable
[friendica.git] / mod / notes.php
index ed54330b3c5c165011c3df4b93e5afa742ae646f..68a870e9d689f282aa4c1a93444bb1d1a3fa68c4 100644 (file)
@@ -59,32 +59,19 @@ function notes_content(App $a, $update = false)
        }
 
        $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
-               'wall' => false, 'allow_cid' => '<' . $a->contact['id'] . '>', 'contact-id'=> $a->contact['id']];
+               'wall' => false, 'contact-id'=> $a->contact['id']];
 
        $a->set_pager_itemspage(40);
 
        $params = ['order' => ['created' => true],
                'limit' => [$a->pager['start'], $a->pager['itemspage']]];
-       $r = Item::selectForUser(local_user(), ['id'], $condition, $params);
+       $r = Item::selectThreadForUser(local_user(), ['uri'], $condition, $params);
 
        $count = 0;
 
        if (DBA::isResult($r)) {
                $count = count($r);
-               $parents_arr = [];
-
-               while ($rr = Item::fetch($r)) {
-                       $parents_arr[] = $rr['id'];
-               }
-               DBA::close($r);
-
-               $condition = ['uid' => local_user(), 'parent' => $parents_arr];
-               $result = Item::selectForUser(local_user(), [], $condition);
-
-               if (DBA::isResult($result)) {
-                       $items = conv_sort(Item::inArray($result), 'commented');
-                       $o .= conversation($a, $items, 'notes', $update);
-               }
+               $o .= conversation($a, DBA::toArray($r), 'notes', $update);
        }
 
        $o .= alt_pager($a, $count);