Show the network icon for the contact

This commit is contained in:
Michael 2021-07-24 12:21:33 +00:00
parent 30aad250df
commit b3b5599d27
3 changed files with 15 additions and 5 deletions

View file

@ -21,6 +21,7 @@
namespace Friendica\Content\Widget;
use Friendica\Content\ContactSelector;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
@ -49,10 +50,12 @@ class VCard
Logger::warning('Incomplete contact', ['contact' => $contact ?? [], 'callstack' => System::callstack(20)]);
}
if (($contact['network'] != '') && ($contact['network'] != Protocol::DFRN)) {
$network_link = Strings::formatNetworkName($contact['network'], $contact['url']);
if ($contact['network'] != '') {
$network_link = Strings::formatNetworkName($contact['network'], $contact['url']);
$network_avatar = ContactSelector::networkToIcon($contact['network'], $contact['url']);
} else {
$network_link = '';
$network_link = '';
$network_avatar = '';
}
$follow_link = '';
@ -93,6 +96,7 @@ class VCard
'$xmpp' => DI::l10n()->t('XMPP:'),
'$location' => DI::l10n()->t('Location:'),
'$network_link' => $network_link,
'$network_avatar' => $network_avatar,
'$network' => DI::l10n()->t('Network:'),
'$account_type' => Contact::getAccountType($contact),
'$follow' => DI::l10n()->t('Follow'),

View file

@ -1167,7 +1167,8 @@ aside .vcard .detail {
display: table;
padding: 5px 0;
}
aside .xmpp {
aside .xmpp,
aside .network {
display: table;
}
aside .vcard .icon {

View file

@ -76,6 +76,11 @@
</div>
{{/if}}
{{if $network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$network_link nofilter}}</dd></dl>{{/if}}
{{if $network_link}}
<div class="network">
<span class="network-label icon"><i class="fa fa-{{$network_avatar}}"></i></span>
<span class="x-network">{{$network_link nofilter}}</span>
</div>
{{/if}}
</div>
</div>