use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Email;
use Friendica\Protocol\Feed;
-use Friendica\Protocol\PortableContact;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
use Friendica\Util\XML;
return;
}
- if (($contact['network'] != Protocol::MAIL) || $force) {
- Contact::updateFromProbe($contact_id, '', $force);
+ if (($contact['network'] != Protocol::MAIL) && $force) {
+ Contact::updateFromProbe($contact_id);
}
// Special treatment for wrongly detected local contacts
if (!$force && ($contact['network'] != Protocol::DFRN) && Contact::isLocalById($contact_id)) {
- Contact::updateFromProbe($contact_id, Protocol::DFRN, true);
+ Contact::updateFromProbe($contact_id, Protocol::DFRN);
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id]);
}
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id]);
}
- // load current friends if possible.
- if (!empty($contact['poco']) && !$contact['failed']) {
- if (!DBA::exists('glink', ["`cid` = ? AND updated > UTC_TIMESTAMP() - INTERVAL 1 DAY", $contact['id']])) {
- PortableContact::loadWorker($contact['id'], $importer_uid, 0, $contact['poco']);
- }
- }
-
// Don't poll if polling is deactivated (But we poll feeds and mails anyway)
if (!in_array($protocol, [Protocol::FEED, Protocol::MAIL]) && DI::config()->get('system', 'disable_polling')) {
Logger::log('Polling is disabled');
return;
}
+ // Don't poll local contacts
+ if (User::getIdForURL($contact['url'])) {
+ Logger::info('Local contacts are not polled', ['id' => $contact['id']]);
+
+ // 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");
}
$cookiejar = tempnam(get_temppath(), 'cookiejar-onepoll-');
- $curlResult = DI::httpRequest()->get($contact['poll'], false, ['cookiejar' => $cookiejar]);
+ $curlResult = DI::httpRequest()->get($contact['poll'], ['cookiejar' => $cookiejar]);
unlink($cookiejar);
if ($curlResult->isTimeout()) {
Logger::log("Mail: no mails for ".$mailconf['user']);
}
+ self::updateContact($contact, ['failed' => false, 'last-update' => $updated, 'success_update' => $updated]);
+ Contact::unmarkForArchival($contact);
+
Logger::log("Mail: closing connection for ".$mailconf['user']);
imap_close($mbox);
}