From 024809f970fc51af5e16931d4fc5b7db2303a285 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 28 Jun 2017 20:07:53 -0700 Subject: conversation fetching is partially working - but it isn't always glueing the conversation pieces together. --- include/feedutils.php | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/feedutils.php b/include/feedutils.php index 184f8ed09..a262b9562 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -1081,14 +1081,27 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { if((! $pmid) && $parent_link !== '') { $f = feed_conversation_fetch($importer,$contact,$parent_link); if($f) { - $x = q("select parent_mid from item where mid = '%s' and uid = %d limit 1", - dbesc($parent_mid), - intval($importer['channel_id']) - ); + // check both potential conversation parents again + if($conv_id) { + $c = q("select parent_mid from item left join iconfig on item.id = iconfig.iid where iconfig.cat = 'ostatus' and iconfig.k = 'conversation' and iconfig.v = '%s' and item.uid = %d order by item.id limit 1", + dbesc($conv_id), + intval($importer['channel_id']) + ); + if($c) { + $pmid = $c[0]['parent_mid']; + $datarray['parent_mid'] = $pmid; + } + } + if(! $pmid) { + $x = q("select parent_mid from item where mid = '%s' and uid = %d limit 1", + dbesc($parent_mid), + intval($importer['channel_id']) + ); - if($x) { - $pmid = $x[0]['parent_mid']; - $datarray['parent_mid'] = $pmid; + if($x) { + $pmid = $x[0]['parent_mid']; + $datarray['parent_mid'] = $pmid; + } } } } -- cgit v1.2.3