diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-24 21:09:21 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-24 21:09:21 -0700 |
commit | 808605cd65bbd56dad9b33ec8ae17abe726477c4 (patch) | |
tree | bca4b41ae9d35d5f5a0d8cc35355b18c55c73d17 /include/feedutils.php | |
parent | 06a674775e5606a98e0e7357b0c88378ca679e6d (diff) | |
download | volse-hubzilla-808605cd65bbd56dad9b33ec8ae17abe726477c4.tar.gz volse-hubzilla-808605cd65bbd56dad9b33ec8ae17abe726477c4.tar.bz2 volse-hubzilla-808605cd65bbd56dad9b33ec8ae17abe726477c4.zip |
ostatus - support likes of comments
Diffstat (limited to 'include/feedutils.php')
-rw-r--r-- | include/feedutils.php | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/include/feedutils.php b/include/feedutils.php index 112e10155..451946114 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -1033,6 +1033,12 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { if(! $datarray['mid']) continue; + $item_parent_mid = q("select parent_mid from item where mid = '%s' and uid = %d limit 1", + dbesc($parent_mid), + intval($importer['channel_id']) + ); + + // This probably isn't an appropriate default but we're about to change it // if it's wrong. @@ -1128,18 +1134,12 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $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) { - logger('find_parent: matched in-reply-to: ' . $parent_mid, LOGGER_DEBUG); - $pmid = $x[0]['parent_mid']; - $datarray['parent_mid'] = $pmid; - } + if(($item_parent_mid) && (! $pmid)) { + logger('find_parent: matched in-reply-to: ' . $parent_mid, LOGGER_DEBUG); + $pmid = $item_parent_mid[0]['parent_mid']; + $datarray['parent_mid'] = $pmid; } + if((! $pmid) && $parent_link !== '') { $f = feed_conversation_fetch($importer,$contact,$parent_link); if($f) { @@ -1161,6 +1161,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { ); if($x) { + $item_parent_mid = $x; $pmid = $x[0]['parent_mid']; $datarray['parent_mid'] = $pmid; } @@ -1242,6 +1243,13 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { set_iconfig($datarray,'system','parent_mid',$parent_mid,true); } + + // allow likes of comments + + if($item_parent_mid && activity_match($datarray['verb'],ACTVITY_LIKE)) { + $datarray['thr_parent'] = $item_parent_mid[0]['parent_mid']; + } + $datarray['aid'] = $importer['channel_account_id']; $datarray['uid'] = $importer['channel_id']; |