aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-28 20:07:53 -0700
committerzotlabs <mike@macgirvin.com>2017-06-28 20:07:53 -0700
commit024809f970fc51af5e16931d4fc5b7db2303a285 (patch)
tree30231f9cae06d42f46d3af3c781454f3b5262450 /include
parent126af3a24a0dffc705235ed083a9192f97749829 (diff)
downloadvolse-hubzilla-024809f970fc51af5e16931d4fc5b7db2303a285.tar.gz
volse-hubzilla-024809f970fc51af5e16931d4fc5b7db2303a285.tar.bz2
volse-hubzilla-024809f970fc51af5e16931d4fc5b7db2303a285.zip
conversation fetching is partially working - but it isn't always glueing the conversation pieces together.
Diffstat (limited to 'include')
-rw-r--r--include/feedutils.php27
1 files changed, 20 insertions, 7 deletions
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;
+ }
}
}
}