use Friendica\Network\Probe;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Images;
-use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
use Friendica\Util\XML;
if (!empty($author["author-avatar"]) && ($author["author-avatar"] != $current['avatar'])) {
Logger::log("Update profile picture for contact ".$contact["id"], Logger::DEBUG);
- Contact::updateAvatar($author["author-avatar"], $importer["uid"], $contact["id"]);
+ Contact::updateAvatar($contact["id"], $author["author-avatar"]);
}
// Ensure that we are having this contact (with uid=0)
// Update the avatar
if (!empty($author["author-avatar"])) {
- Contact::updateAvatar($author["author-avatar"], 0, $cid);
+ Contact::updateAvatar($cid, $author["author-avatar"]);
}
}
// Only add additional data when there is no picture in the post
if (!strstr($item["body"], '[/img]')) {
- $item["body"] = PageInfo::appendToBody($item["body"]);
+ $item["body"] = PageInfo::searchAndAppendToBody($item["body"]);
}
Tag::storeFromBody($item['uri-id'], $item['body']);
self::$conv_list[$conversation] = true;
- $curlResult = Network::curl($conversation, false, ['accept_content' => 'application/atom+xml, text/html']);
+ $curlResult = DI::httpRequest()->get($conversation, false, ['accept_content' => 'application/atom+xml, text/html']);
if (!$curlResult->isSuccess()) {
return;
}
}
if ($file != '') {
- $conversation_atom = Network::curl($attribute['href']);
+ $conversation_atom = DI::httpRequest()->get($attribute['href']);
if ($conversation_atom->isSuccess()) {
$xml = $conversation_atom->getBody();
return;
}
- $curlResult = Network::curl($self);
+ $curlResult = DI::httpRequest()->get($self);
if (!$curlResult->isSuccess()) {
return;
}
$stored = false;
- $curlResult = Network::curl($related, false, ['accept_content' => 'application/atom+xml, text/html']);
+ $curlResult = DI::httpRequest()->get($related, false, ['accept_content' => 'application/atom+xml, text/html']);
if (!$curlResult->isSuccess()) {
return;
}
}
if ($atom_file != '') {
- $curlResult = Network::curl($atom_file);
+ $curlResult = DI::httpRequest()->get($atom_file);
if ($curlResult->isSuccess()) {
Logger::log('Fetched XML for URI ' . $related_uri, Logger::DEBUG);
// Workaround for older GNU Social servers
if (($xml == '') && strstr($related, '/notice/')) {
- $curlResult = Network::curl(str_replace('/notice/', '/api/statuses/show/', $related).'.atom');
+ $curlResult = DI::httpRequest()->get(str_replace('/notice/', '/api/statuses/show/', $related) . '.atom');
if ($curlResult->isSuccess()) {
Logger::log('GNU Social workaround to fetch XML for URI ' . $related_uri, Logger::DEBUG);
// Even more worse workaround for GNU Social ;-)
if ($xml == '') {
$related_guess = self::convertHref($related_uri);
- $curlResult = Network::curl(str_replace('/notice/', '/api/statuses/show/', $related_guess).'.atom');
+ $curlResult = DI::httpRequest()->get(str_replace('/notice/', '/api/statuses/show/', $related_guess) . '.atom');
if ($curlResult->isSuccess()) {
Logger::log('GNU Social workaround 2 to fetch XML for URI ' . $related_uri, Logger::DEBUG);