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

View File

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

View File

@ -76,6 +76,11 @@
</div> </div>
{{/if}} {{/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>
</div> </div>