Changed query for the public timeline

This commit is contained in:
Michael 2021-02-09 17:56:17 +00:00
parent 91ecbb1754
commit c918e83aa2

View file

@ -1731,16 +1731,16 @@ function api_statuses_public_timeline($type)
$start = max(0, ($page - 1) * $count); $start = max(0, ($page - 1) * $count);
if ($exclude_replies && !$conversation_id) { if ($exclude_replies && !$conversation_id) {
$condition = ["`gravity` IN (?, ?) AND `iid` > ? AND `private` = ? AND `wall` AND NOT `author-hidden`", $condition = ["`gravity` = ? AND `id` > ? AND `private` = ? AND `wall` AND NOT `author-hidden`",
GRAVITY_PARENT, GRAVITY_COMMENT, $since_id, Item::PUBLIC]; GRAVITY_PARENT, $since_id, Item::PUBLIC];
if ($max_id > 0) { if ($max_id > 0) {
$condition[0] .= " AND `iid` <= ?"; $condition[0] .= " AND `id` <= ?";
$condition[] = $max_id; $condition[] = $max_id;
} }
$params = ['order' => ['iid' => true], 'limit' => [$start, $count]]; $params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = Post::selectThreadForUser(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params); $statuses = Post::selectForUser(api_user(), [], $condition, $params);
$r = Post::toArray($statuses); $r = Post::toArray($statuses);
} else { } else {