From b3b5599d2705923c225c6f00233c2abd2a2729a1 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 24 Jul 2021 12:21:33 +0000 Subject: [PATCH] Show the network icon for the contact --- src/Content/Widget/VCard.php | 10 +++++++--- view/theme/frio/css/style.css | 3 ++- view/theme/frio/templates/widget/vcard.tpl | 7 ++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php index e3550b28b8..ffe4759f5c 100644 --- a/src/Content/Widget/VCard.php +++ b/src/Content/Widget/VCard.php @@ -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'), diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index e5d30d1d2c..4ec229fc3e 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -1167,7 +1167,8 @@ aside .vcard .detail { display: table; padding: 5px 0; } -aside .xmpp { +aside .xmpp, +aside .network { display: table; } aside .vcard .icon { diff --git a/view/theme/frio/templates/widget/vcard.tpl b/view/theme/frio/templates/widget/vcard.tpl index 69fb4d4afd..5bd481a96a 100644 --- a/view/theme/frio/templates/widget/vcard.tpl +++ b/view/theme/frio/templates/widget/vcard.tpl @@ -76,6 +76,11 @@ {{/if}} - {{if $network_link}}
{{$network}}
{{$network_link nofilter}}
{{/if}} + {{if $network_link}} +
+ + {{$network_link nofilter}} +
+ {{/if}}