attempt to group gnu-social and mastodon conversations by ostatus:conversation in addition to falling back on thr:in_reply_to
This commit is contained in:
parent
dd8feac540
commit
7f374fe69f
@ -1003,20 +1003,35 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$x = q("select mid from item where mid = '%s' and uid = %d limit 1",
|
$pmid = '';
|
||||||
dbesc($parent_mid),
|
$conv_id = get_iconfig($datarray,'ostatus','conversation');
|
||||||
intval($importer['channel_id'])
|
|
||||||
);
|
|
||||||
|
|
||||||
if($x) {
|
if($conv_id) {
|
||||||
$pmid = $x[0]['mid'];
|
$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",
|
||||||
$datarray['parent_mid'] = $pmid;
|
dbesc($conv_id),
|
||||||
|
intval($importer['channel_id'])
|
||||||
|
);
|
||||||
|
if($c) {
|
||||||
|
$pmid = $x[0]['parent_mid'];
|
||||||
|
$datarray['parent_mid'] = $pmid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$x = q("select mid from item where mid = '%s' and uid = %d limit 1",
|
||||||
|
dbesc($parent_mid),
|
||||||
|
intval($importer['channel_id'])
|
||||||
|
);
|
||||||
|
|
||||||
|
if($x) {
|
||||||
|
$pmid = $x[0]['mid'];
|
||||||
|
$datarray['parent_mid'] = $pmid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! $pmid) {
|
||||||
|
|
||||||
// immediate parent wasn't found. Turn into a top-level post if permissions allow
|
// immediate parent wasn't found. Turn into a top-level post if permissions allow
|
||||||
// but save the thread_parent in case we need to refer to it later. We should probably
|
// but save the thread_parent in case we need to refer to it later.
|
||||||
// also save the ostatus:conversation_id
|
|
||||||
|
|
||||||
if(! post_is_importable($datarray, $contact))
|
if(! post_is_importable($datarray, $contact))
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user