From: Michael Date: Tue, 9 Feb 2021 17:56:17 +0000 (+0000) Subject: Changed query for the public timeline X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c918e83aa2b3e45537e79f6930c7d1ab4daa89be;p=friendica.git Changed query for the public timeline --- diff --git a/include/api.php b/include/api.php index a96681b83e..130c420e48 100644 --- a/include/api.php +++ b/include/api.php @@ -1731,16 +1731,16 @@ function api_statuses_public_timeline($type) $start = max(0, ($page - 1) * $count); if ($exclude_replies && !$conversation_id) { - $condition = ["`gravity` IN (?, ?) AND `iid` > ? AND `private` = ? AND `wall` AND NOT `author-hidden`", - GRAVITY_PARENT, GRAVITY_COMMENT, $since_id, Item::PUBLIC]; + $condition = ["`gravity` = ? AND `id` > ? AND `private` = ? AND `wall` AND NOT `author-hidden`", + GRAVITY_PARENT, $since_id, Item::PUBLIC]; if ($max_id > 0) { - $condition[0] .= " AND `iid` <= ?"; + $condition[0] .= " AND `id` <= ?"; $condition[] = $max_id; } - $params = ['order' => ['iid' => true], 'limit' => [$start, $count]]; - $statuses = Post::selectThreadForUser(api_user(), Item::DISPLAY_FIELDLIST, $condition, $params); + $params = ['order' => ['id' => true], 'limit' => [$start, $count]]; + $statuses = Post::selectForUser(api_user(), [], $condition, $params); $r = Post::toArray($statuses); } else {