]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/ContactSelector.php
Merge pull request #8036 from nupplaphil/task/redundant_system_call
[friendica.git] / src / Content / ContactSelector.php
index 478cfdbbe8da6c5e623d40263cde2b6b2c0bf64f..7a36ea8c681be56a7ad77e9755402e2d96f76fce 100644 (file)
@@ -105,12 +105,13 @@ class ContactSelector
        }
 
        /**
-        * @param string $network network
-        * @param string $profile optional, default empty
+        * @param string $network  network of the contact
+        * @param string $profile  optional, default empty
+        * @param string $protocol (Optional) Protocol that is used for the transmission
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function networkToName($network, $profile = "")
+       public static function networkToName($network, $profile = '', $protocol = '')
        {
                $nets = [
                        Protocol::DFRN      =>   L10n::t('DFRN'),
@@ -125,6 +126,7 @@ class ContactSelector
                        Protocol::GPLUS     =>   L10n::t('Google+'),
                        Protocol::PUMPIO    =>   L10n::t('pump.io'),
                        Protocol::TWITTER   =>   L10n::t('Twitter'),
+                       Protocol::DISCOURSE =>   L10n::t('Discourse'),
                        Protocol::DIASPORA2 =>   L10n::t('Diaspora Connector'),
                        Protocol::STATUSNET =>   L10n::t('GNU Social Connector'),
                        Protocol::ACTIVITYPUB => L10n::t('ActivityPub'),
@@ -161,6 +163,10 @@ class ContactSelector
                        }
                }
 
+               if (!empty($protocol) && ($protocol != $network)) {
+                       $networkname = L10n::t('%s (via %s)', $networkname, self::networkToName($protocol));
+               }
+
                return $networkname;
        }
 
@@ -185,6 +191,7 @@ class ContactSelector
                        Protocol::GPLUS     =>   'google-plus',
                        Protocol::PUMPIO    =>   'file-text-o', /// @todo
                        Protocol::TWITTER   =>   'twitter',
+                       Protocol::DISCOURSE =>   'dot-circle-o', /// @todo
                        Protocol::DIASPORA2 =>   'diaspora',
                        Protocol::STATUSNET =>   'gnu-social',
                        Protocol::ACTIVITYPUB => 'activitypub',