]> git.mxchange.org Git - friendica.git/commitdiff
Re-enable pinned items in profile wall
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Jan 2020 19:14:36 +0000 (14:14 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Jan 2020 19:21:20 +0000 (14:21 -0500)
include/conversation.php
src/Module/Profile/Status.php

index ed273a52ce22c70985df1b77c6bfeb1b2f372b1a..3f500717aa14e6959dfad8ba47995e41cdd97b7b 100644 (file)
@@ -791,7 +791,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
 /**
  * Fetch all comments from a query. Additionally set the newest resharer as thread owner.
  *
- * @param array   $thread_items Database statement with thread posts
+ * @param mixed   $thread_items Database statement with thread posts
  * @param boolean $pinned       Is the item pinned?
  *
  * @return array items with parents and comments
index 5e1ec2538457c6c8eefe6a1d6a5b08ddc4ee6b1f..ce68a8f3e3c19cfa5f6f47cd519e1fbfe1a32fcc 100644 (file)
@@ -206,7 +206,13 @@ class Status extends BaseProfile
 
                $items = DBA::toArray($items_stmt);
 
-               $o .= conversation($a, $items, $pager, 'profile', false, false, 'received', $a->profile['uid']);
+               if ($pager->getStart() == 0 && !empty($a->profile['uid'])) {
+                       $pinned_items = Item::selectPinned($a->profile['uid'], ['uri', 'pinned']);
+                       $pinned = Item::inArray($pinned_items);
+                       $items = array_merge($items, $pinned);
+               }
+
+               $o .= conversation($a, $items, $pager, 'profile', false, false, 'pinned_received', $a->profile['uid']);
 
                $o .= $pager->renderMinimal(count($items));