]> git.mxchange.org Git - friendica.git/commitdiff
Photos should point to the local system
authorMichael <heluecht@pirati.ca>
Thu, 17 Jun 2021 16:55:54 +0000 (16:55 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 17 Jun 2021 16:55:54 +0000 (16:55 +0000)
src/Object/Api/Mastodon/Account.php

index 691e62048d68dc836ccbe9f2d27729ab89dab5de..04601da218a29c7484093a6dc16022d91cf90888 100644 (file)
@@ -28,6 +28,7 @@ use Friendica\Content\Text\BBCode;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Proxy;
 
 /**
  * Class Account
@@ -112,10 +113,10 @@ class Account extends BaseDataTransferObject
 
                $this->note            = BBCode::convert($publicContact['about'], false);
                $this->url             = $publicContact['url'];
-               $this->avatar          = $userContact['avatar'] ?? $publicContact['avatar'];
-               $this->avatar_static   = $userContact['avatar'] ?? $publicContact['avatar'];
-               $this->header          = ($userContact['header'] ?? $publicContact['header']) ?? '';
-               $this->header_static   = ($userContact['header'] ?? $publicContact['header']) ?? '';
+               $this->avatar          = ($userContact['photo'] ?? $publicContact['photo']) ?: Proxy::proxifyUrl($userContact['avatar'] ?? $publicContact['avatar']);
+               $this->avatar_static   = $this->avatar;
+               $this->header          = Proxy::proxifyUrl(($userContact['header'] ?? $publicContact['header']) ?? '');
+               $this->header_static   = $this->header;
                $this->followers_count = $apcontact['followers_count'] ?? 0;
                $this->following_count = $apcontact['following_count'] ?? 0;
                $this->statuses_count  = $apcontact['statuses_count'] ?? 0;