mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 05:35:12 +00:00
more work on zap missing parents
This commit is contained in:
parent
8afb181e7a
commit
a47aae22d0
1 changed files with 16 additions and 3 deletions
|
@ -1537,6 +1537,8 @@ class Libzot {
|
|||
$DR->update('comment parent not found');
|
||||
$result[] = $DR->get();
|
||||
|
||||
$fetch_ap = false;
|
||||
|
||||
// We don't seem to have a copy of this conversation or at least the parent
|
||||
// - so request a copy of the entire conversation to date.
|
||||
// Don't do this if it's a relay post as we're the ones who are supposed to
|
||||
|
@ -1557,13 +1559,24 @@ class Libzot {
|
|||
if($f === false) {
|
||||
// This might be an ActivityPub conversation and not a Zot6 conversation.
|
||||
Activity::fetch_and_store_parents($channel,$sender,null,$arr);
|
||||
$fetch_ap = true;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
if($fetch_ap) {
|
||||
// If we're fetching via activitypub we won't have stored the current item
|
||||
// check again for existence and if we now have a parent, continue so we can store it
|
||||
|
||||
$fap = q("select route, id, parent_mid, mid, owner_xchan, item_private from item where mid = '%s' and uid = %d limit 1",
|
||||
dbesc($arr['parent_mid']),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
}
|
||||
if(! $fap) {
|
||||
continue;
|
||||
}
|
||||
$r = $fap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($relay || $friendofriend || (intval($r[0]['item_private']) === 0 && intval($arr['item_private']) === 0)) {
|
||||
// reset the route in case it travelled a great distance upstream
|
||||
// use our parent's route so when we go back downstream we'll match
|
||||
|
|
Loading…
Reference in a new issue