X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FOStatus.php;h=fe8f060aa3fffdf68ca6da5205fd5b08516c5467;hb=341d8860d15cd2224a3595dfa3c553b03658ef60;hp=076602f9ab61f1f9b14811bcd389f4a1274f4964;hpb=db60557a4f1066639e1af0650f1e5f13e576bcb1;p=friendica.git diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 076602f9ab..fe8f060aa3 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -38,8 +38,7 @@ use Friendica\Model\ItemURI; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Model\User; -use Friendica\Network\HTTPClient\Client\HttpClient; -use Friendica\Network\HTTPClient\Client\HttpClientOptions; +use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; use Friendica\Util\Images; @@ -732,7 +731,7 @@ class OStatus self::$conv_list[$conversation] = true; - $curlResult = DI::httpClient()->get($conversation, [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_ATOM_XML]); + $curlResult = DI::httpClient()->get($conversation, HttpClientAccept::ATOM_XML); if (!$curlResult->isSuccess() || empty($curlResult->getBody())) { return; @@ -762,7 +761,7 @@ class OStatus } } if ($file != '') { - $conversation_atom = DI::httpClient()->get($attribute['href'], [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_ATOM_XML]); + $conversation_atom = DI::httpClient()->get($attribute['href'], HttpClientAccept::ATOM_XML); if ($conversation_atom->isSuccess()) { $xml = $conversation_atom->getBody(); @@ -876,7 +875,7 @@ class OStatus return; } - $curlResult = DI::httpClient()->get($self, [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_ATOM_XML]); + $curlResult = DI::httpClient()->get($self, HttpClientAccept::ATOM_XML); if (!$curlResult->isSuccess()) { return; @@ -926,7 +925,7 @@ class OStatus } $stored = false; - $curlResult = DI::httpClient()->get($related, [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_ATOM_XML]); + $curlResult = DI::httpClient()->get($related, HttpClientAccept::ATOM_XML); if (!$curlResult->isSuccess() || empty($curlResult->getBody())) { return; @@ -958,7 +957,7 @@ class OStatus } } if ($atom_file != '') { - $curlResult = DI::httpClient()->get($atom_file, [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_ATOM_XML]); + $curlResult = DI::httpClient()->get($atom_file, HttpClientAccept::ATOM_XML); if ($curlResult->isSuccess()) { Logger::info('Fetched XML for URI ' . $related_uri); @@ -970,7 +969,7 @@ class OStatus // Workaround for older GNU Social servers if (($xml == '') && strstr($related, '/notice/')) { - $curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related) . '.atom', [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_ATOM_XML]); + $curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related) . '.atom', HttpClientAccept::ATOM_XML); if ($curlResult->isSuccess()) { Logger::info('GNU Social workaround to fetch XML for URI ' . $related_uri); @@ -981,7 +980,7 @@ class OStatus // Even more worse workaround for GNU Social ;-) if ($xml == '') { $related_guess = self::convertHref($related_uri); - $curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related_guess) . '.atom', [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_ATOM_XML]); + $curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related_guess) . '.atom', HttpClientAccept::ATOM_XML); if ($curlResult->isSuccess()) { Logger::info('GNU Social workaround 2 to fetch XML for URI ' . $related_uri);