+ // load current friends if possible.
+ if (!empty($contact['poco']) && ($contact['success_update'] > $contact['failure_update'])) {
+ $r = q("SELECT count(*) AS total FROM glink
+ WHERE `cid` = %d AND updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
+ intval($contact['id'])
+ );
+ if (DBA::isResult($r)) {
+ if (!$r[0]['total']) {
+ PortableContact::loadWorker($contact['id'], $importer_uid, 0, $contact['poco']);
+ }
+ }
+ }
+
+ // We don't poll our followers
+ if ($contact["rel"] == Contact::FOLLOWER) {
+ Logger::log("Don't poll follower");
+
+ // set the last-update so we don't keep polling
+ DBA::update('contact', ['last-update' => $updated], ['id' => $contact['id']]);
+ return;
+ }
+
+ // Don't poll if polling is deactivated (But we poll feeds and mails anyway)
+ if (!in_array($protocol, [Protocol::FEED, Protocol::MAIL]) && Config::get('system', 'disable_polling')) {
+ Logger::log('Polling is disabled');
+
+ // set the last-update so we don't keep polling
+ DBA::update('contact', ['last-update' => $updated], ['id' => $contact['id']]);
+ return;
+ }
+
+ // We don't poll AP contacts by now
+ if ($protocol === Protocol::ACTIVITYPUB) {
+ Logger::log("Don't poll AP contact");
+
+ // set the last-update so we don't keep polling
+ DBA::update('contact', ['last-update' => $updated], ['id' => $contact['id']]);