Merge pull request #11366 from annando/pinned

Issue 11310: Show pinned posts when not logged in
This commit is contained in:
Hypolite Petovan 2022-03-21 19:14:42 -04:00 committed by GitHub
commit 5a4018a05b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -454,7 +454,7 @@ class Conversation
. "'; </script>\r\n"; . "'; </script>\r\n";
} }
} elseif ($mode === 'profile') { } elseif ($mode === 'profile') {
$items = $this->addChildren($items, false, $order, local_user()); $items = $this->addChildren($items, false, $order, $uid);
if (!$update) { if (!$update) {
$tab = !empty($_GET['tab']) ? trim($_GET['tab']) : 'posts'; $tab = !empty($_GET['tab']) ? trim($_GET['tab']) : 'posts';
@ -929,7 +929,7 @@ class Conversation
$condition = DBA::mergeConditions($condition, $condition = DBA::mergeConditions($condition,
["`uid` IN (0, ?) AND (`vid` != ? OR `vid` IS NULL)", $uid, Verb::getID(Activity::FOLLOW)]); ["`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 = []; $items = [];

View File

@ -218,7 +218,7 @@ class Status extends BaseProfile
} elseif ($profile['uid'] == local_user()) { } elseif ($profile['uid'] == local_user()) {
$condition = []; $condition = [];
} }
$pinned_items = Post::selectPinned($profile['uid'], ['uri-id', 'pinned'], $condition); $pinned_items = Post::selectPinned($profile['uid'], ['uri-id', 'pinned'], $condition);
$pinned = Post::toArray($pinned_items); $pinned = Post::toArray($pinned_items);
$items = array_merge($items, $pinned); $items = array_merge($items, $pinned);