X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FOnePoll.php;h=83a7a5f15c228c0bd6fc016cc5fd553c77192094;hb=0e82f64d71b598a1349ac22973148715f7182fdd;hp=b2c49c9f1dfa5af17227ea438c2770e1588285e3;hpb=edcfeaf66d797cc6bc9edf966b91b5eb95e5f127;p=friendica.git diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index b2c49c9f1d..83a7a5f15c 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -1,6 +1,6 @@ $contact_id]); - $force = ($command == "force"); + $force = ($command == 'force'); if (empty($contact_id)) { Logger::notice('no contact provided'); @@ -117,6 +119,7 @@ class OnePoll * * @param array $contact The personal contact entry * @param array $fields The fields that are updated + * @return void * @throws \Exception */ private static function updateContact(array $contact, array $fields) @@ -154,7 +157,7 @@ class OnePoll } $cookiejar = tempnam(System::getTempPath(), 'cookiejar-onepoll-'); - $curlResult = DI::httpClient()->get($contact['poll'], [HttpClientOptions::COOKIEJAR => $cookiejar]); + $curlResult = DI::httpClient()->get($contact['poll'], HttpClientAccept::FEED_XML, [HttpClientOptions::COOKIEJAR => $cookiejar]); unlink($cookiejar); if ($curlResult->isTimeout()) { @@ -173,7 +176,7 @@ class OnePoll return false; } - Logger::notice('Consume feed of contact', ['id' => $contact['id'], 'url' => $contact['poll']]); + Logger::notice('Consume feed of contact', ['id' => $contact['id'], 'url' => $contact['poll'], 'Content-Type' => $curlResult->getHeader('Content-Type')]); return !empty(Feed::import($xml, $importer, $contact)); } @@ -245,6 +248,9 @@ class OnePoll $datarray['verb'] = Activity::POST; $datarray['object-type'] = Activity\ObjectType::NOTE; $datarray['network'] = Protocol::MAIL; + $datarray['protocol'] = Conversation::PARCEL_IMAP; + $datarray['direction'] = Conversation::PULL; + // $meta = Email::messageMeta($mbox, $msg_uid); $datarray['thr-parent'] = $datarray['uri'] = Email::msgid2iri(trim($meta->message_id, '<>')); @@ -388,7 +394,7 @@ class OnePoll $datarray = Email::getMessage($mbox, $msg_uid, $reply, $datarray); if (empty($datarray['body'])) { - Logger::notice("Mail: can't fetch msg ".$msg_uid." for ".$mailconf['user']); + Logger::warning('Cannot fetch mail', ['msg-id' => $msg_uid, 'uid' => $mailconf['user']]); continue; }