X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FOnePoll.php;h=5fc65b211a1d4f4414d896c64ef1d64c5f737f97;hb=3a1fef43b237a4fcb75d7880aa81808a66c56f2d;hp=fbd1ab4e59f9fd608f2b2330ac087459ec13c3f5;hpb=398e65d66b929a4931f62477f86ea1df6fe99c9a;p=friendica.git diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index fbd1ab4e59..5fc65b211a 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -32,7 +32,6 @@ use Friendica\Protocol\Activity; 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; @@ -61,13 +60,13 @@ class OnePoll 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]); } @@ -95,13 +94,6 @@ class OnePoll $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'); @@ -111,6 +103,15 @@ class OnePoll 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"); @@ -707,6 +708,9 @@ class OnePoll 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); }