aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-04 18:06:38 -0800
committerfriendica <info@friendica.com>2013-01-04 18:06:38 -0800
commite208e07e35ddd59cf7d5476f6176e7d3a79b6ca4 (patch)
tree17ba0d86110f896cd22e8140b3c5651f626d062a
parent9253eaa98abc6863fcf40f17e2bfaacf68b69941 (diff)
downloadvolse-hubzilla-e208e07e35ddd59cf7d5476f6176e7d3a79b6ca4.tar.gz
volse-hubzilla-e208e07e35ddd59cf7d5476f6176e7d3a79b6ca4.tar.bz2
volse-hubzilla-e208e07e35ddd59cf7d5476f6176e7d3a79b6ca4.zip
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.
-rwxr-xr-xinclude/items.php10
1 files changed, 9 insertions, 1 deletions
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)
);