From bd016dc6800896330a32961b5d1aaaf298c6ad99 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 17 Jun 2021 16:55:54 +0000 Subject: [PATCH 1/2] Photos should point to the local system --- src/Object/Api/Mastodon/Account.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Object/Api/Mastodon/Account.php b/src/Object/Api/Mastodon/Account.php index 691e62048d..04601da218 100644 --- a/src/Object/Api/Mastodon/Account.php +++ b/src/Object/Api/Mastodon/Account.php @@ -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; From b184df1108eaba6fd450ffafff4c9334805c4fee Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 17 Jun 2021 19:14:35 +0200 Subject: [PATCH 2/2] Update src/Object/Api/Mastodon/Account.php Co-authored-by: Hypolite Petovan --- src/Object/Api/Mastodon/Account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Object/Api/Mastodon/Account.php b/src/Object/Api/Mastodon/Account.php index 04601da218..58a7c5ffe6 100644 --- a/src/Object/Api/Mastodon/Account.php +++ b/src/Object/Api/Mastodon/Account.php @@ -115,7 +115,7 @@ class Account extends BaseDataTransferObject $this->url = $publicContact['url']; $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 = 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;