mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:35:19 +00:00
conversation completion: stop motherless children sneaking into conversation fetches from collections
This commit is contained in:
parent
4fa7358bcc
commit
8e48997ad0
3 changed files with 7 additions and 4 deletions
|
@ -39,7 +39,7 @@ class Convo implements DaemonInterface
|
|||
|
||||
$collection = new ASCollection($id, $channel);
|
||||
|
||||
$messages = $collection->fetchAndParse();
|
||||
$messages = $collection->fetchAndParse(true);
|
||||
|
||||
if ($messages) {
|
||||
foreach ($messages as $message) {
|
||||
|
|
|
@ -149,7 +149,7 @@ class ASCollection
|
|||
logger('nextpage: ' . $this->nextpage, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
public function fetchAndParse()
|
||||
public function fetchAndParse($children_only = false)
|
||||
{
|
||||
$results = [];
|
||||
$messages = $this->get();
|
||||
|
@ -165,7 +165,7 @@ class ASCollection
|
|||
else {
|
||||
continue;
|
||||
}
|
||||
$fetched = Activity::fetch_and_parse($messageId, $channel);
|
||||
$fetched = Activity::fetch_and_parse($messageId, $channel, $children_only);
|
||||
if ($fetched) {
|
||||
$results[] = $fetched;
|
||||
}
|
||||
|
|
|
@ -4717,7 +4717,7 @@ class Activity
|
|||
}
|
||||
}
|
||||
|
||||
public static function fetch_and_parse($message_id, $channel)
|
||||
public static function fetch_and_parse($message_id, $channel, $children_only = false)
|
||||
{
|
||||
if (ActivityStreams::is_url($message_id)) {
|
||||
$json = self::fetch($message_id, $channel);
|
||||
|
@ -4761,6 +4761,9 @@ class Activity
|
|||
if (!$item) {
|
||||
return false;
|
||||
}
|
||||
if ($children_only && $item['mid'] === $item['parent_mid']) {
|
||||
return false;
|
||||
}
|
||||
$hookinfo = [
|
||||
'activity' => $activity,
|
||||
'item' => $item,
|
||||
|
|
Loading…
Reference in a new issue