Some more avatar function replacements

This commit is contained in:
Michael 2020-07-28 19:30:55 +00:00
parent 701dbdf7fc
commit 71b6226909
15 changed files with 47 additions and 63 deletions

View file

@ -27,7 +27,6 @@ use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Util\Proxy as ProxyUtils;
/**
* This class handles methods related to the forum functionality
@ -72,7 +71,7 @@ class ForumManager
$forumlist = [];
$fields = ['id', 'url', 'name', 'micro', 'thumb'];
$fields = ['id', 'url', 'name', 'micro', 'thumb', 'avatar'];
$condition = [$condition_str, Protocol::DFRN, Protocol::ACTIVITYPUB, $uid];
$contacts = DBA::select('contact', $fields, $condition, $params);
if (!$contacts) {
@ -131,7 +130,7 @@ class ForumManager
'name' => $contact['name'],
'cid' => $contact['id'],
'selected' => $selected,
'micro' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO)),
'micro' => DI::baseUrl()->remove(Contact::getMicro($contact)),
'id' => ++$id,
];
$entries[] = $entry;

View file

@ -30,7 +30,6 @@ use Friendica\Core\Search;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
use Friendica\Util\XML;
use League\HTMLToMarkdown\HtmlConverter;
@ -868,7 +867,7 @@ class HTML
'$click' => $contact['click'] ?? '',
'$class' => $class,
'$url' => $url,
'$photo' => ProxyUtils::proxifyUrl($contact['thumb'], false, ProxyUtils::SIZE_THUMB),
'$photo' => Contact::getThumb($contact),
'$name' => $contact['name'],
'title' => $contact['name'] . ' [' . $contact['addr'] . ']',
'$parkle' => $sparkle,

View file

@ -34,7 +34,6 @@ use Friendica\Model\Group;
use Friendica\Model\Item;
use Friendica\Model\Profile;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
@ -432,10 +431,11 @@ class Widget
$entries = [];
foreach ($r as $rr) {
$contact = Contact::getByURL($rr['url']);
$entry = [
'url' => Contact::magicLink($rr['url']),
'name' => $rr['name'],
'photo' => ProxyUtils::proxifyUrl($rr['photo'], false, ProxyUtils::SIZE_THUMB),
'name' => $contact['name'] ?? $rr['name'],
'photo' => Contact::getThumb($contact, $rr['photo']),
];
$entries[] = $entry;
}

View file

@ -98,7 +98,7 @@ class ContactBlock
$contact_ids[] = $contact["id"];
}
$contacts_stmt = DBA::select('contact', ['id', 'uid', 'addr', 'url', 'name', 'thumb', 'network'], ['id' => $contact_ids]);
$contacts_stmt = DBA::select('contact', ['id', 'uid', 'addr', 'url', 'name', 'thumb', 'avatar', 'network'], ['id' => $contact_ids]);
if (DBA::isResult($contacts_stmt)) {
$contacts_title = DI::l10n()->tt('%d Contact', '%d Contacts', $total);