]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/ContactSelector.php
Blanks replaced
[friendica.git] / src / Content / ContactSelector.php
index b2e607113786cea674ad21d03136b0b8bdf97961..6c7e09945f9f594ae81b0905a94dceeba7876b42 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -184,7 +184,7 @@ class ContactSelector
         * @return string
         * @throws \Exception
         */
-       public static function networkToIcon($network, $profile = "")
+       public static function networkToIcon($network, $profile = "", $gsid = 0)
        {
                $nets = [
                        Protocol::DFRN      =>   'friendica',
@@ -218,7 +218,14 @@ class ContactSelector
                $network_icon = str_replace($search, $replace, $network);
 
                if ((in_array($network, Protocol::FEDERATED)) && ($profile != "")) {
-                       $gserver = self::getServerForProfile($profile);
+                       if (!empty($gsid) && !empty(self::$serverdata[$gsid])) {
+                               $gserver = self::$serverdata[$gsid];
+                       } elseif (!empty($gsid)) {
+                               $gserver = DBA::selectFirst('gserver', ['platform', 'network'], ['id' => $gsid]);
+                               self::$serverdata[$gsid] = $gserver;
+                       } else {
+                               $gserver = self::getServerForProfile($profile);
+                       }
                        if (!empty($gserver['platform'])) {
                                $network_icon = $platform_icons[strtolower($gserver['platform'])] ?? $network_icon;
                        }