From e208e07e35ddd59cf7d5476f6176e7d3a79b6ca4 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 4 Jan 2013 18:06:38 -0800 Subject: Make zot_feeds in ascending created order so that we'll see parents before kids. Otherwise if we get a kid and we don't have a parent we'll drop it. --- include/items.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 9d856673f..8e4e2dd8d 100755 --- a/include/items.php +++ b/include/items.php @@ -4266,12 +4266,20 @@ function zot_feed($uid,$observer,$mindate) { if($mindate != '0000-00-00 00:00:00') $sql_extra .= " and created > '$mindate' "; + +// FIXME + // We probably should use two queries and pick up total conversations. + // For now get a chunk of raw posts in ascending created order so that + // hopefully the parent is imported before we see the kids. + // This will fail if there are more than $limit kids and you didn't + // receive the parent via direct delivery + $limit = 200; $items = q("SELECT item.* from item WHERE uid = %d AND item_restrict = 0 AND (item_flags & %d) - $sql_extra ORDER BY created DESC limit 0, $limit", + $sql_extra ORDER BY created ASC limit 0, $limit", intval($uid), intval(ITEM_WALL) ); -- cgit v1.2.3