From e5ab4f18893b24babca751e676f10390a2d49a22 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 26 Jan 2020 14:14:36 -0500 Subject: [PATCH] Re-enable pinned items in profile wall --- include/conversation.php | 2 +- src/Module/Profile/Status.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index ed273a52c..3f500717a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -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 diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 5e1ec2538..ce68a8f3e 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -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));