Fetch photo fields, ensuring that they are filled

This commit is contained in:
Michael 2020-07-28 12:58:19 +00:00
parent 74bc3de472
commit b79bb0d2cb
12 changed files with 82 additions and 32 deletions

View file

@ -26,8 +26,8 @@ use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model;
use Friendica\Model\Contact;
use Friendica\Module;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
function common_content(App $a)
@ -136,7 +136,7 @@ function common_content(App $a)
'url' => Model\Contact::magicLink($common_friend['url']),
'itemurl' => ($contact_details['addr'] ?? '') ?: $common_friend['url'],
'name' => $contact_details['name'],
'thumb' => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB),
'thumb' => Contact::getThumb($contact_details),
'img_hover' => $contact_details['name'],
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],

View file

@ -27,7 +27,6 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Util\Proxy as ProxyUtils;
/**
* Controller for /match.
@ -111,7 +110,7 @@ function match_content(App $a)
'tags' => $contact_details['keywords'] ?? '',
'about' => $contact_details['about'] ?? '',
'account_type' => Contact::getAccountType($contact_details),
'thumb' => ProxyUtils::proxifyUrl($profile->photo, false, ProxyUtils::SIZE_THUMB),
'thumb' => Contact::getThumb($contact_details, $profile->photo),
'conntxt' => DI::l10n()->t('Connect'),
'connlnk' => $connlnk,
'img_hover' => $profile->tags,

View file

@ -20,7 +20,6 @@
*/
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
@ -29,9 +28,7 @@ use Friendica\Content\Text\HTML;
use Friendica\Core\ACL;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
@ -41,7 +38,6 @@ use Friendica\Model\Post\Category;
use Friendica\Model\Profile;
use Friendica\Module\Security\Login;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
function network_init(App $a)
@ -587,7 +583,7 @@ function networkThreadedView(App $a, $update, $parent)
'id' => 'network',
'name' => $contact['name'],
'itemurl' => ($contact['addr'] ?? '') ?: $contact['nurl'],
'thumb' => ProxyUtils::proxifyUrl($contact['thumb'], false, ProxyUtils::SIZE_THUMB),
'thumb' => Contact::getThumb($contact),
'details' => $contact['location'],
];

View file

@ -34,7 +34,6 @@ use Friendica\Model\Verb;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\XML;
/**
@ -329,11 +328,7 @@ function ping_init(App $a)
if (DBA::isResult($notifs)) {
foreach ($notifs as $notif) {
$contact = Contact::getByURL($notif['url'], false, ['micro']);
if (isset($contact['micro'])) {
$notif['photo'] = ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO);
} else {
$notif['photo'] = ProxyUtils::proxifyUrl($notif['photo'], false, ProxyUtils::SIZE_MICRO);
}
$notif['photo'] = Contact::getMicro($contact, $notif['photo']);
$local_time = DateTimeFormat::local($notif['date']);