]> git.mxchange.org Git - friendica.git/commitdiff
Changed detection for specific software
authorMichael <heluecht@pirati.ca>
Wed, 28 Aug 2019 09:10:25 +0000 (09:10 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 28 Aug 2019 09:10:25 +0000 (09:10 +0000)
src/Content/ContactSelector.php

index 2f6677aba1cfc13b564139ac2d67f48748c1dd5e..aa4942683ac4cdc6329b63fd61933f8289f09540 100644 (file)
@@ -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;
        }