onepoll: improvements in fetching outbox content

This commit is contained in:
nobody 2021-04-12 22:37:08 -07:00
parent f0045a39a0
commit 32d03a825d
2 changed files with 10 additions and 6 deletions

View file

@ -124,7 +124,7 @@ class Onepoll {
// prohibitive as deletion requests would need to be relayed over potentially hostile networks.
if($fetch_feed) {
$max = intval(get_config('system','max_imported_posts',50));
$max = intval(get_config('system','max_imported_posts',100));
if (intval($max)) {
$cl = get_xconfig($xchan,'activitypub','collections');
if (is_array($cl) && $cl) {
@ -139,10 +139,14 @@ class Onepoll {
if (is_string($message)) {
$message = Activity::fetch($message,$importer);
}
$AS = new ActivityStreams($message,null,true);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS,true);
Activity::store($importer,$contact['abook_xchan'],$AS,$item);
if (is_array($message)) {
$AS = new ActivityStreams($message,null,true);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS,true);
if ($item) {
Activity::store($importer,$contact['abook_xchan'],$AS, $item, true, true);
}
}
}
}
}

View file

@ -140,7 +140,7 @@ class Search extends Controller {
if (! $author) {
$author = $item['author_xchan'];
}
Activity::store(App::get_channel(),get_observer_hash(),$AS,$item);
Activity::store(App::get_channel(),get_observer_hash(),$AS,$item, true, true);
}
}
if ($hash) {