X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FOnePoll.php;h=99d5054ca3b8727ed9077d3410abdeb1f749e62c;hb=ab83d0dd27e46e733ecb49f25789bfb318852ac7;hp=eea5b19560d8df2a02009724a61691dd061cd8ea;hpb=43f0f6bbdccc309839f7c66995480649c37e376a;p=friendica.git diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index eea5b19560..99d5054ca3 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -1,6 +1,6 @@ $importer_uid]); // set the last-update so we don't keep polling - DBA::update('contact', ['last-update' => $updated], ['id' => $contact['id']]); + Contact::update(['last-update' => $updated], ['id' => $contact['id']]); return; } @@ -121,16 +122,16 @@ class OnePoll { if (in_array($contact['network'], [Protocol::FEED, Protocol::MAIL, Protocol::OSTATUS])) { // Update the user's contact - DBA::update('contact', $fields, ['id' => $contact['id']]); + Contact::update($fields, ['id' => $contact['id']]); // Update the public contact - DBA::update('contact', $fields, ['uid' => 0, 'nurl' => $contact['nurl']]); + Contact::update($fields, ['uid' => 0, 'nurl' => $contact['nurl']]); // Update the rest of the contacts that aren't polled - DBA::update('contact', $fields, ['rel' => Contact::FOLLOWER, 'nurl' => $contact['nurl']]); + Contact::update($fields, ['rel' => Contact::FOLLOWER, 'nurl' => $contact['nurl']]); } else { // Update all contacts - DBA::update('contact', $fields, ['nurl' => $contact['nurl']]); + Contact::update($fields, ['nurl' => $contact['nurl']]); } } @@ -152,7 +153,7 @@ class OnePoll } $cookiejar = tempnam(get_temppath(), 'cookiejar-onepoll-'); - $curlResult = DI::httpRequest()->get($contact['poll'], ['cookiejar' => $cookiejar]); + $curlResult = DI::httpClient()->get($contact['poll'], [HTTPClientOptions::COOKIEJAR => $cookiejar]); unlink($cookiejar); if ($curlResult->isTimeout()) { @@ -455,10 +456,10 @@ class OnePoll Logger::info('Hub subscription start', ['mode' => $hubmode, 'name' => $contact['name'], 'hub' => $url, 'endpoint' => $push_url, 'verifier' => $verify_token]); if (!strlen($contact['hub-verify']) || ($contact['hub-verify'] != $verify_token)) { - DBA::update('contact', ['hub-verify' => $verify_token], ['id' => $contact['id']]); + Contact::update(['hub-verify' => $verify_token], ['id' => $contact['id']]); } - $postResult = DI::httpRequest()->post($url, $params); + $postResult = DI::httpClient()->post($url, $params); Logger::info('Hub subscription done', ['result' => $postResult->getReturnCode()]);