use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
-use Friendica\Network\HTTPRequest;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
function discourse_fetch_post($host, $topic, $pid)
{
$url = $host . '/t/' . $topic . '/' . $pid . '.json';
- $curlResult = HTTPRequest::curl($url);
+ $curlResult = DI::httpRequest()->get($url);
if (!$curlResult->isSuccess()) {
Logger::info('No success', ['url' => $url]);
return false;
{
$hostaddr = 'https://' . $host;
$url = $hostaddr . '/posts/' . $post . '.json';
- $curlResult = HTTPRequest::curl($url);
+ $curlResult = DI::httpRequest()->get($url);
if (!$curlResult->isSuccess()) {
return false;
}
$avatar = $contact['photo'];
unset($contact['photo']);
DBA::update('contact', $contact, ['id' => $contact['id']]);
- Contact::updateAvatar($avatar, 0, $contact['id']);
+ Contact::updateAvatar($contact['id'], $avatar);
$contact['photo'] = $avatar;
}