diff --git a/src/Model/Contact.php b/src/Model/Contact.php index c666fed7bf..d0febc8bba 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2316,7 +2316,10 @@ class Contact if ($uid == 0) { if ($ret['network'] == Protocol::ACTIVITYPUB) { - ActivityPub\Processor::fetchFeaturedPosts($ret['url']); + $apcontact = APContact::getByURL($ret['url'], false); + if (!empty($apcontact['featured'])) { + Worker::add(PRIORITY_LOW, 'FetchFeaturedPosts', $ret['url']); + } } $ret['last-item'] = Probe::getLastUpdate($ret); diff --git a/src/Worker/FetchFeaturedPosts.php b/src/Worker/FetchFeaturedPosts.php new file mode 100644 index 0000000000..757cc9c460 --- /dev/null +++ b/src/Worker/FetchFeaturedPosts.php @@ -0,0 +1,39 @@ +. + * + */ + +namespace Friendica\Worker; + +use Friendica\Core\Logger; +use Friendica\Protocol\ActivityPub; + +class FetchFeaturedPosts +{ + /** + * Fetch featured posts from a contact with the given URL + * @param string $url Contact URL + */ + public static function execute(string $url) + { + Logger::info('Start fetching featured posts', ['url' => $url]); + ActivityPub\Processor::fetchFeaturedPosts($url); + Logger::info('Finished fetching featured posts', ['url' => $url]); + } +}