From a2a5f05a1987486af3c12b4c243ca496783f64cf Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 21 Mar 2022 22:58:23 +0000 Subject: [PATCH] Issue 11310: Show pinned posts when not logged in --- src/Content/Conversation.php | 4 ++-- src/Module/Profile/Status.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index e441e8ba4b..48265ce513 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -454,7 +454,7 @@ class Conversation . "'; \r\n"; } } elseif ($mode === 'profile') { - $items = $this->addChildren($items, false, $order, local_user()); + $items = $this->addChildren($items, false, $order, $uid); if (!$update) { $tab = !empty($_GET['tab']) ? trim($_GET['tab']) : 'posts'; @@ -929,7 +929,7 @@ class Conversation $condition = DBA::mergeConditions($condition, ["`uid` IN (0, ?) AND (`vid` != ? OR `vid` IS NULL)", $uid, Verb::getID(Activity::FOLLOW)]); - $thread_items = Post::selectForUser(local_user(), array_merge(ItemModel::DISPLAY_FIELDLIST, ['pinned', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params); + $thread_items = Post::selectForUser($uid, array_merge(ItemModel::DISPLAY_FIELDLIST, ['pinned', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params); $items = []; diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index bb4537d6cc..8919267990 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -218,7 +218,7 @@ class Status extends BaseProfile } elseif ($profile['uid'] == local_user()) { $condition = []; } - + $pinned_items = Post::selectPinned($profile['uid'], ['uri-id', 'pinned'], $condition); $pinned = Post::toArray($pinned_items); $items = array_merge($items, $pinned);