X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FOnePoll.php;h=99d5054ca3b8727ed9077d3410abdeb1f749e62c;hb=ab83d0dd27e46e733ecb49f25789bfb318852ac7;hp=73971a8b1b59f8b81bdf7f47accc265106cf59f5;hpb=794f98f479edb00c47bbdf51022718fe9dd61fbf;p=friendica.git diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index 73971a8b1b..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; } @@ -120,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']]); } } @@ -151,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()) { @@ -244,12 +246,12 @@ class OnePoll $datarray['network'] = Protocol::MAIL; // $meta = Email::messageMeta($mbox, $msg_uid); - $datarray['uri'] = Email::msgid2iri(trim($meta->message_id, '<>')); + $datarray['thr-parent'] = $datarray['uri'] = Email::msgid2iri(trim($meta->message_id, '<>')); // Have we seen it before? $fields = ['deleted', 'id']; $condition = ['uid' => $importer_uid, 'uri' => $datarray['uri']]; - $item = Item::selectFirst($fields, $condition); + $item = Post::selectFirst($fields, $condition); if (DBA::isResult($item)) { Logger::log("Mail: Seen before ".$msg_uid." for ".$mailconf['user']." UID: ".$importer_uid." URI: ".$datarray['uri'],Logger::DEBUG); @@ -298,7 +300,7 @@ class OnePoll } } $condition = ['uri' => $refs_arr, 'uid' => $importer_uid]; - $parent = Item::selectFirst(['uri'], $condition); + $parent = Post::selectFirst(['uri'], $condition); if (DBA::isResult($parent)) { $datarray['thr-parent'] = $parent['uri']; } @@ -331,7 +333,7 @@ class OnePoll if (empty($datarray['thr-parent']) && $reply) { $condition = ['title' => $datarray['title'], 'uid' => $importer_uid, 'network' => Protocol::MAIL]; $params = ['order' => ['created' => true]]; - $parent = Item::selectFirst(['uri'], $condition, $params); + $parent = Post::selectFirst(['uri'], $condition, $params); if (DBA::isResult($parent)) { $datarray['thr-parent'] = $parent['uri']; } @@ -454,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()]);