From ed4d08c7f44961370f6ab4f256be1b167e1e8ee9 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 28 Aug 2019 09:10:25 +0000 Subject: [PATCH] Changed detection for specific software --- src/Content/ContactSelector.php | 53 ++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 2f6677aba1..aa4942683a 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -81,7 +81,7 @@ class ContactSelector $server_url = ''; // Fetch the server url from the contact table - $contact = DBA::selectFirst('contact', ['baseurl'], ['nurl' => Strings::normaliseLink($profile)]); + $contact = DBA::selectFirst('contact', ['baseurl'], ['uid' => 0, 'nurl' => Strings::normaliseLink($profile)]); if (DBA::isResult($contact) && !empty($contact['baseurl'])) { $server_url = Strings::normaliseLink($contact['baseurl']); } @@ -174,21 +174,21 @@ class ContactSelector { $nets = [ Protocol::DFRN => 'friendica', - Protocol::OSTATUS => 'gnu-social', + Protocol::OSTATUS => 'gnu-social', // There is no generic OStatus icon Protocol::FEED => 'rss', - Protocol::MAIL => '', + Protocol::MAIL => 'file-text-o', /// @todo Protocol::DIASPORA => 'diaspora', Protocol::ZOT => 'hubzilla', Protocol::LINKEDIN => 'linkedin', Protocol::XMPP => 'xmpp', - Protocol::MYSPACE => '', + Protocol::MYSPACE => 'file-text-o', /// @todo Protocol::GPLUS => 'google-plus', - Protocol::PUMPIO => '', + Protocol::PUMPIO => 'file-text-o', /// @todo Protocol::TWITTER => 'twitter', Protocol::DIASPORA2 => 'diaspora', Protocol::STATUSNET => 'gnu-social', Protocol::ACTIVITYPUB => 'activitypub', - Protocol::PNUT => '', + Protocol::PNUT => 'file-text-o', /// @todo ]; $search = array_keys($nets); @@ -203,27 +203,32 @@ class ContactSelector $gserver = DBA::selectFirst('gserver', ['platform'], ['nurl' => $server_url]); if (DBA::isResult($gserver) && !empty($gserver['platform'])) { - switch (strtolower($gserver['platform'])) { - case 'friendica': - $networkicon = 'friendica'; - break; - case 'hubzilla': - $networkicon = 'hubzilla'; - break; - case 'mastodon': - $networkicon = 'mastodon'; - break; - case 'pleroma': - $networkicon = 'pleroma'; - break; - } +/* +BlackGerman.space +ganggo +groundpolis +Juick +misskey +mobilizon +MounKareal +read.as +social-relay +twista +writefreely + +ostatus +red +redmatrix +StatusNet +*/ + $icons = ['diaspora' => 'diaspora', 'friendica' => 'friendica', 'friendika' => 'friendica', + 'GNU Social' => 'gnu-social', 'gnusocial' => 'gnu-social', 'hubzilla' => 'hubzilla', + 'mastodon' => 'mastodon', 'peertube' => 'peertube', 'pixelfed' => 'pixelfed', + 'pleroma' => 'pleroma', 'socialhome' => 'social-home', 'wordpress' => 'wordpress']; + $networkicon = $icons[strtolower($gserver['platform'])] ?? $networkicon; } } - if (empty($networkicon)) { - $networkicon = 'file-text-o'; - } - return $networkicon; } -- 2.39.5